1. Home
  2. Computing & Technology
  3. Web Design / HTML

How To Change the Font Using CSS

By Jennifer Kyrnin, About.com

The <font> tag has been deprecated, so it is a good idea to use CSS to change the face of your text. Learn how to change a specific portion of text using <span> and CSS.
Difficulty: Average
Time Required: 5 minutes

Here's How:

  1. Write your text: this is in Arial
  2. Surround the text with the span tag: <span>this is in Arial</span>
  3. Add the attribute style="" to the span tag: <span style="">this is in Arial</span>
  4. Within the style attribute, change the font face (or family) using the font-family style: <span style="font-family : Arial;">this is in Arial</span>

Tips:

  1. Separate multiple font choices with a comma (,).
  2. Always end all CSS styles with a semi-colon (;). It's not required when there is only one, but it's a good habit to get into.
  3. Keep in mind that if your audience uses older browsers, you might not want to use CSS, as it won't display correctly.

What You Need:

  • HTML Editor -or-
  • Text Editor
More Web Design / HTML How To's

Explore Web Design / HTML

More from About.com

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2008 About.com, a part of The New York Times Company.

All rights reserved.