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 ...

Get Practical Web Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.