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

Chapter 4. CSS Selectors > The STYLE Attribute

The STYLE Attribute

The STYLE attribute is different from the other attributes described in this chapter. Whereas CLASS and ID attribute values can be used in selectors, the STYLE attribute is actually a replacement for the entire selector mechanism. Instead of having a value that can be referred to in a selector (which is what ID and CLASS have), the value of the STYLE attribute is actually one or more CSS declarations.

Normally, using CSS, a designer will put all style rules into a style sheet that goes into the STYLE element at the top of the document (or is linked externally as described in Chapter 14, “External style sheets”). However, using the STYLE attribute, you can bypass the style sheet and put declarations directly into the start tags of your document.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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