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

How To Change the Font Using CSS

By , About.com Guide

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: this is in Arial
  3. Add the attribute style="" to the span tag: this is in Arial
  4. Within the style attribute, change the font face (or family) using the font-family style: this is in Arial
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
Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.