ব্যাকগ্রাউন্ড-অ্যাটাচমেন্ট সেট করতে, ব্যাকগ্রাউন্ড-অ্যাটাচমেন্ট প্রপার্টি ব্যবহার করুন। পটভূমি সংযুক্তি নির্ধারণ করে যে একটি পটভূমি চিত্র স্থির করা হয়েছে বা বাকি পৃষ্ঠার সাথে স্ক্রোল করা হয়েছে।
উদাহরণ
নিশ্চিত ব্যাকগ্রাউন্ড ইমেজ সেট করতে ব্যাকগ্রাউন্ড-অ্যাটাচমেন্ট প্রপার্টির সাথে কিভাবে কাজ করবেন তা শিখতে আপনি নিম্নলিখিত কোডটি চালানোর চেষ্টা করতে পারেন:
<!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>