Share this Page URL

Transferring Your Web Pages > Some WS_FTP Tips - Pg. 253

254 Learn HTML 4 In a Weekend maroon, navy, olive, purple, red, silver, teal, or yellow) or an RGB hex code ( #ff6600; , for instance). You've already added a style rule that uses one of the 16 standard color names (blue) to apply a color to the H1 element (see Figure 8.1). Since there isn't an orange color among the 16 standard color names, use an RGB hex code to specify that the H2 element should be displayed in an orange color (see Figure 8.2): <style type="text/css"> h1 { color: blue; } h2 { color: #ff6600; } </style> Setting a Transparent Background Color Unlike with the FONT element, styles allow you to also set a background color for an element. When setting a foreground color for an element, it is recommended that you also always either specify a background color or declare that the background is transparent. That is because users can also create their own style sheets and may set a background color for an element if you don't. Thus, if you set a blue foreground color for an element, but not a background color, you could end up displaying your blue foreground color against a user's blue background color. Set the backgrounds of the H1 and H2 elements to be transparent: Figure 8.2 A style uses an RGB hex code (#ff6600) to cause all H2 elements to be colored orange. H2 element (color: #ff6600)