style backgroundRepeat প্রপার্টি ব্যবহার করে ব্যাকগ্রাউন্ড ইমেজ কীভাবে রিপিট হবে তা সেট বা গেট করা হয়।
সিনট্যাক্স
backgroundRepeat প্রপার্টি সেট করার সিনট্যাক্স:
object.style.backgroundRepeat = "repeat|repeat-x|repeat-y|no-repeat|initial|inherit"
মানসমূহ
| ক্রম | মান ও বিবরণ |
|---|---|
| ১ | repeat ডিফল্ট মান। ব্যাকগ্রাউন্ড ইমেজ লম্ব এবং আড়াঢালে উভয় দিকেই রিপিট হয়। |
| ২ | repeat-x ব্যাকগ্রাউন্ড ইমেজ শুধু আড়াঢালে (horizontally) রিপিট হয়। |
| ৩ | repeat-y ব্যাকগ্রাউন্ড ইমেজ শুধু লম্বে (vertically) রিপিট হয়। |
| ৪ | no-repeat ব্যাকগ্রাউন্ড ইমেজ রিপিট হয় না। |
উদাহরণ
backgroundRepeat প্রপার্টির উদাহরণ:
<!DOCTYPE html> <html> <head> <style>
body {
background-image: url("https://www.tutorialspoint.com/power_bi/images/power-bi-minilogo.jpg");
background-repeat: repeat-x;
color:black;
font-size:20px;
}
</style>
<script>
function changeBackRepeat(){
document.body.style.backgroundRepeat="repeat-y";
document.getElementById("Sample").innerHTML="The background image is now repeated vertically";
}
</script>
</head>
<body>
<h2>Demo Heading</h2>
<p>This is demo text.</p>
<p>This is demo text.</p>
<p>This is demo text.</p>
<p>This is demo text.</p>
<p>Change the body background image repeat value by clicking the below button</p>
<button onclick="changeBackRepeat()">CHANGE REPEAT</button>
<p id="Sample"></p>
</body> </html>
আউটপুট
নিচের আউটপুট তৈরি হবে:

CHANGE REPEAT বাটনে ক্লিক করলে:
