- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Setting up Background Color using CSS
To set background color using CSS, use the background-color property.
Example
Let us now see an example −
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; background-color: red; } </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> .demo { text-decoration: overline underline; } </style> </head> <body style="background-color: orange;color: white;"> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
Output
- Related Articles
- Setting up Background Color in CSS
- Setting Background Position using CSS
- Setting Background Image using CSS
- Setting Text Color using CSS
- Setting the Color of Links using CSS
- Setting the Location Color Stops using CSS
- Setting Background Position in CSS
- Setting Background color for Tkinter in Python
- Setting Color Property in CSS
- Setting the element's text color using CSS
- Setting Text Color Working with CSS
- Usage of background-color property in CSS
- Setting Line Height using CSS
- Setting Text Alignment using CSS
- Set the background color of an element with CSS

Advertisements