copyright © CSSPG, lud February 28 1999


 for practical use of CSS

CSS Example: Highlight

this document is located at...
<URI:http://css.nu/examples/highlight.html>

* Highlights with CSS *

The question of whether CSS can coexist with HTML attributes arises frequently in the comp.infosystems.www.authoring.stylesheets newsgroup. A transitional DOCTYPE has been provided for authors who want to provide presentation suggestions for what may be referred to as 'legacy browsers', and the lists below show the use of CSS named colors used in conjunction with HTML's <STRONG> and <EM> attributes.

Use of this type of markup is entirely at the author's discretion, but authors might well be reminded that "Less is more". Overuse of highlighting or other emphasis may detract from the readibility of a page. Judicious use of emphasis is encouraged.

(1) If you don't understand the problem with this line, please review Warren Steele's essay, What's Wrong with the Font Element? which happens to apply in equal measure to background color declarations without text color declarations.

 These are the 16 color names mentioned in CSS1, with their sRGB values:

     Black  = #000000    Green  = #008000
     Silver = #C0C0C0    Lime   = #00FF00
     Gray   = #808080    Olive  = #808000
     White  = #FFFFFF    Yellow = #FFFF00
     Maroon = #800000    Navy   = #000080
     Red    = #FF0000    Blue   = #0000FF
     Purple = #800080    Teal   = #008080
     Fuchsia= #FF00FF    Aqua   = #00FFFF

CSS Pointers Navigation
Index · Browser Bugs · Books · Tools · DHTML · XSL & DSSSL
Main Site Navigation
Index · Articles · Examples · Experiments · FAQ · Markup · Styles · Who is?
CSSPG ~ Sue ~ Roland
Validate markup Check CSS