

- 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
Set the background color of an element with CSS
To set the background color of an element, use the background-color property.
Example
You can try to run the following code to learn how to work with the background-color property:
<html> <head> <body> <p style = "background-color:blue;"> This text has a blue background color.</p> </body> </head> <html>
- Related Questions & Answers
- Set the background image of an element with CSS
- Set the opacity for the background color with CSS
- How to return the background color of an element with JavaScript DOM?
- Change the background color of a button with CSS
- Set the Background Attachment with CSS
- Set the Color of links with CSS
- Set the font stretch of an element with CSS
- Set the right margin of an element with CSS
- Set the top margin of an element with CSS
- Set the color of the border with CSS
- Set the color of the outline with CSS
- Add a red background color to an element to set danger action with Bootstrap
- Add a blue background color to an element to set key stuff with Bootstrap
- Add a green background color to an element to set positive action with Bootstrap
- Add a yellow background color to an element to set warning action with Bootstrap
Advertisements