XML technologies / CSS / Advanced websites with CSS / Using fonts with CSS / How CSS handles fonts

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

CSS opens unexpected possibilities for HTML designers working with fonts. HTML offers only seven font sizes, for example, while CSS provides an almost unlimited scaling range. Defining alternative typefaces also greatly improves compatibility across systems. (Note: Alternative fonts could already be defined with the HTML tag <font>, but this was never part of the official standard.) CSS also has dedicated values for font weight, italics and even small capitals.

Since CSS was introduced, the HTML tag <font> has officially been deprecated and fully replaced by the broad range of font properties. This chapter uses the following:

Combining these properties gives us a large repertoire for styling and controlling text display. First, however, let us examine them individually.

  

 

 

 

back to top