H I O X INDIA
FREE CSS Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 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
Feedback





CSS Text/Font Color


Topic

How to set color to a text or word in html using style sheet?




Explanation

From now on we will be looking in to different properties that can be handled / controlled by css.

Property: Color

Usage:
color: red;
color: rgb(125,234,124);
color: #343434;

Definition:
Colors for html font/text can be set using the css tag "color".
It accepts values in three formats
a)color name
b)rgb(x,y,z) where x,y,z is red,green,blue
c)#xxyyz where xx,yy,zz points to hexadecimal values of red,green,blue

Example:
The following examples will show on how to set color for a font or text in html using css.
<div style="color: green;"> color name </div>
<div style="color: rgb(125,125,125);"> color using rgb(x,y,z) </div>
<div style="color: #343434;"> color using hex values</div>

Result:
color name

color using rgb(x,y,z)

color using hex values










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-2005 HIOX INDIA - hioxindia.com