O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.2. Controlling text properties with style

CSS font properties provide a more logical set of tools to control the way texts are displayed on a Web page. They are more powerful than the FONT attribute introduced in HTML 3.x or earlier. Thus, unless backward compatibility is required, CSS properties are used throughout this book.

Some frequently used CSS properties related to font are listed in Table 2.1.

Table 2.1. Font family, size, weight, style, and color
CSS propertyCSS valuesNSIEDescriptionCSS version
Color#rrggbb color name4.+4.+Sets the color of the font in 24-bit red, green, blue modeCSS1
Font
font-family,
font-size,
font-style,
font-weight
4.+4.+A shorthand property to set all font valuesCSS1
Font familyFamily nameGeneric family4.+4.+A prioritized ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required