Sử dụng tệp đính kèm nền thuộc tính hiển thị hình nền dưới dạng cố định.
Ví dụ
Bạn có thể thử chạy mã sau để triển khai background-attachment tài sản -
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: right top;
}
</style>
</head>
<body>
<h1>Background Image</h1>
</body>
</html>