H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
More about CSS
Feedback





CSS Background Color


Topic

How to set the background color for html tags using style sheet?
I want background color for few words only, how to do it?




Explanation


Property: BackGround Color

Usage:
background-color: red;
background-color: #343434;
background-color: transparent;

Definition:
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.

The following examples will show on how to set the background color in html using the css tag.

Example 1:
<font style="background-color: green;"> color name </font>

Result:
color name


Example 2:
<font style="background-color: #888888;"> html text background using css</font>

Result:
html text background using css


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

Result:
transparent backgrounds can also be given using css




A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA