
This is a legacy document, and retained on the site in order to avoid link rot. The content is likely no longer (a) accurate, (b) representative of the views and philosophies of current site management, or (c) up to date.
CSS Example: Highlight
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.
- Strong red background.
- Strong blue background.
- Strong green background.
- Strong yellow background.
- Strong teal background.
- Strong maroon background.
- Strong black background. (1)
- Strong purple background.
- Strong aqua background.
- Strong fuchsia background.
- Strong white background.
- Strong gray background.
- Strong lime background.
- Strong navy background.
- Strong silver background.
- Strong olive background.
- Emphasized red background.
- Emphasized blue background.
- Emphasized green background.
- Emphasized yellow background.
- Emphasized teal background.
- Emphasized maroon background.
- Emphasized black background.
- Emphasized purple background.
- Emphasized aqua background.
- Emphasized fuchsia background.
- Emphasized white background.
- Emphasized gray background.
- Emphasized lime background.
- Emphasized navy background.
- Emphasized silver background.
- Emphasized olive background.
(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= #000000Green= #008000Silver = #C0C0C0Lime = #00FF00Gray = #808080Olive= #808000White= #FFFFFFYellow = #FFFF00Maroon = #800000Navy = #000080Red= #FF0000Blue = #0000FFPurple = #800080Teal = #008080Fuchsia= #FF00FFAqua = #00FFFF
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.