

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Background Repeat in CSS
Background repeat in CSS is used to set how a background image is repeated on a web page. For this, use the background-repeat property. Following can be the property values −
background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|inherit;
Example
Let us now see an example −
<!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>
Output
Example
Let us now see another example −
<!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>
Output
- Related Questions & Answers
- Background Repeat Using CSS
- Repeat the background image with CSS
- Usage of background-repeat property in CSS
- Repeat the background image both horizontally and vertically with CSS
- CSS border-image-repeat
- CSS background property
- CSS Background Properties
- Background Attachment in CSS
- Repeat a linear gradient with CSS
- Repeat a radial gradient with CSS
- CSS Multi background property
- CSS background-size property
- CSS background-origin property
- CSS background-clip property
- CSS background-image property
Advertisements