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

Chapter 4. CSS Selectors > Simple Attribute Selectors

Simple Attribute Selectors

One of the most powerful ways on which to base selection is on an attribute. Recall from Chapter 1, “The Web and HTML,” that an attribute is a characteristic quality, other than the type or content of an element. In that chapter, we discussed the attributes HREF, SRC, and ALT. In this section, we discuss two other attributes: CLASS and ID.

Both these attributes can be used with any HTML element, and we will see how they can create powerful selectors. They are not the only attributes that can occur in a selector, but they are very common, and CSS makes using CLASS and ID especially easy. How to refer to other attributes is explained in the section, “Advanced attribute selectors.”


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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