Prev | Current Page 129 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"


Restrictions imposed by browsers and the screen must be taken into account, such as it
being harder to read type onscreen than in print. This is largely related to resolution. Even
magazines with fairly low-quality print tend to be printed at around 200 dpi or more??”
more than twice the resolution of a typical monitor. This means that very small text
(favored by many designers, who think such small text looks neat) becomes tricky to read
onscreen, because there aren??™t enough pixels to create a coherent image.
I??™ll note restrictions such as this at appropriate times during this section on styling text with
CSS, thereby providing advice on striking a balance between the visual appearance and
practicality of web-based text.
Defining font colors
In CSS, the color property value defines the foreground color of the relevant CSS element,
which for text sets its color. This can be set using hex, keywords, or RGB. The following
examples show each method in turn, and all have the same result: setting
paragraphs to black.
p {
color: #000000;
}
p {
color: black;
}
p {
color: rgb(0,0,0);
}
WORKING WITH TYPE
71
3
Declaring colors using RGB is rare in web design??”hex is most popular, especially because
CSS supports so few keywords (see the section ???Working with hex??? in Chapter 4).
Remember to test your choices on both Windows and Mac, because there are differences
in the default color space for each platform. In general terms, the Mac default display settings
are brighter (or Windows is darker, depending on your outlook on life); if you use
subtle dark tones on the Mac, or very light tones on Windows, the result might be tricky to
view on the other platform.


Pages:
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141