การทำซ้ำพื้นหลังใน CSS ใช้เพื่อกำหนดวิธีการทำซ้ำรูปภาพพื้นหลังบนหน้าเว็บ สำหรับสิ่งนี้ ให้ใช้คุณสมบัติ background-repeat ต่อไปนี้สามารถเป็นค่าคุณสมบัติ -
background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|inherit;
ตัวอย่าง
เรามาดูตัวอย่างกัน −
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("https://www.tutorialspoint.com/images/Swift.png");
background-repeat: repeat-x;
background-color: blue;
color: white;
}
.demo {
text-decoration: overline underline;
}
</style>
</head>
<body>
<h1>Details</h1>
<p class="demo">Examination Center near ABC College.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html> ผลลัพธ์

ตัวอย่าง
เรามาดูตัวอย่างอื่นกัน −
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-image: url("https://www.tutorialspoint.com/images/Swift.png");
background-repeat: repeat-y;
background-color: orange;
color: white;
}
.demo {
text-decoration: overline underline;
}
</style>
</head>
<body>
<h1>Details</h1>
<p class="demo">Examination Center near ABC College.</p>
<p class="demo2">Exam begins at 9AM.</p>
</body>
</html> ผลลัพธ์
