Glossary

NEWS & TIPS

  • Site Access Keys
  • Top: Alt+t
    Previous: Alt+,
    Next: Alt+.
    Up: Alt+;
    (Note: use Ctrl on the Mac)

CSS Class

A CSS class is a special component of Cascading Style Sheets that may be used to target unique elements within an XHTML document and assign CSS properties to them. In contrast to a typical CSS definition such as a rule that targets all <p> elements within a document, a class may be used to target a specific <p> element in the document while skipping the others. Implementing a class within an XHTML document may be useful when an element or group of elements need to stand out on the page with different style properties.

Example XHTML and CSS

XHTML Page (index.html)



Cascading Style Sheet (styles.css)

The XHTML document above contains three paragraphs within its body. The attached, example CSS file styles all <body> and <p> with their respective properties. The page background is blue and the font has been set to Arial with a letter height of 11 pixels. All paragraphs on the page will have 10-pixel margins, and their text color will be white by default except for the last paragraph with the class attribute “red.” The name “red” in the paragraph class attribute corresponds to the CSS class definition “.red” in the CSS file. Since the class contains a foreground color property set to “red,” the color of the paragraph text will consequently be red instead of white.

In Cascade Server, an administrator may configure a selection of CSS classes to be made available in a drop down box in the WYSIWYG editor. Users can then select the appropriate classes visually as they enter content.

See Also

Last modified on Thu, 14 Aug 2008 12:52:37 -0400

Topic Feedback Form

Content Rating:
Email:
Feedback:


Top / Previous / Next / Up / Table of Contents