Latest Post

Background Color

How to set the background color for html tags using style sheet?
How to assign background color for few words?


Background Color in html can be set using the css property background-color.
It accepts values in two formats

a) Color name
b) #xxyyz where xx,yy,zz points to hexadecimal values of red,green,blue
c) Transparent background can also be set in css.


Example 1:

 <font style="background-color: pink;"> color name </font>  

Result :
color name 

Example 2: 
 <font style="background-color: #00000;"> background</font>  

Result:
background

Example 3:  

 <font style="background-color: transparent; color:green;"> transparent backgrounds can also be given using css</font>  

Result :
transparent backgrounds can also be given using css