• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Cascading Style Sheets > The Elements of Styles

The Elements of Styles

At the simplest level, a style is nothing more than a rule that tells the browser how to render a particular HTML or XHTML tag’s contents.[49] Each tag has a number of style properties associated with it, whose values define how that tag is rendered by the browser. A rule defines a specific value for one or more properties of a tag. For example, most tags have a color property, the value of which defines the color in which Netscape or Internet Explorer should display the contents of the tag. Other properties include fonts, line spacing, margins, borders, sound volume, and voice, which we describe in detail later in this chapter.

There are three ways to attach a style to a tag: inline, on the document level, or through the use of an external style sheet. You may use one or more style sheets for your documents. The browser either merges the style definitions from each style or redefines the style characteristic for a tag’s contents. Styles from these various sources are applied to your document, combining and defining style properties that cascade from external style sheets through local document styles, ending with inline styles. This cascade of properties and style rules gives rise to the standard’s name: Cascading Style Sheets.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint