Css Tutorial – How to change website text font and color using css

Jul 09, 2012, by admin

cssThis is the newest technology to style your web pages? Here’s how!

1.Understand how css works with HTML. For example:

<span style=”(css)”>Text</span>

Almost any HTML tag can include “style,” such as

p

or

div

What goes in between the quotes is the CSS part.

 2.To change text font, use css’

font-family

For example:

<span style=”font-family:times;”>Text</span>

will cause “Text” to use the Times font.

3. To set an order of preference, in case a particular font is not on a person’s computer, use commas to seperate font names. For example:

<span style=”font-family:times, georgia, serif;”>Text</span>

will cause “Text” to use the Times font. If times is not available, Georgia will be used. If neither Times nor Georgia are available, a generic serif font will be used.

4.To set text color, use css’

font

For example:

<span style=”font:red;”>Text</span>

will cause “Text” to be red. You can use any valid HTML color name in the place of “red.” You can also use a hex code. For example:

<span style=”font:#FFFFFF;”>Text</span>

will cause “Text” to be white.