background-attachment를 설정하려면 background-attachment 속성을 사용하십시오. 배경 첨부는 배경 이미지를 고정할지 아니면 페이지의 나머지 부분과 함께 스크롤할지 결정합니다.
예시
고정 배경 이미지를 설정하기 위해 background-attachment 속성을 사용하는 방법을 배우려면 다음 코드를 실행해 보세요.
<!DOCTYPE html> <html> <head> <style> body { background-image: url('/css/images/css.jpg'); background-repeat: no-repeat; background-attachment: fixed; } </style> </head> <body> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> <p>The background-image is fixed. Try to scroll down the page.</p> </body> </html>