배경 위치는 배경 이미지의 시작 위치를 설정하는 것입니다. 이를 위해 background-position 속성을 사용하십시오.
예시
이제 예를 살펴보겠습니다 -
<!DOCTYPE html> <html> <head> <style> body { background-image: url("https://www.tutorialspoint.com/images/Swift.png"); background-repeat: no-repeat; background-attachment: fixed; color: blue; background-position: left center; } .demo { text-decoration: overline underline; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
출력
예시
이제 다른 예를 살펴보겠습니다 -
<!DOCTYPE html> <html> <head> <style> body { background-image: url("https://www.tutorialspoint.com/images/Swift.png"); background-repeat: no-repeat; background-attachment: fixed; color: blue; background-position: 50% 50%; } </style> </head> <body> <h1>Details</h1> <p>Examination Center near ABC College.</p> <p>Exam begins at 9AM.</p> </body> </html>
출력