background-attachment property ব্যবহার করে পটভূমির ছবির স্ক্রোলিং নিয়ন্ত্রণ করা যায়।
উদাহরণ
নিচের কোডটি রান করে background-attachment property-র কাজ শিখুন:
<!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>
</body>
</html>
মান: scroll (ডিফল্ট), fixed, local। fixed দিলে ছবি ভিউপোর্টের সাথে স্থির থাকে।