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

CLASS and ID as Selectors

In preparation for the full implementation of CSS, the forward-looking HTML 4.0 specification added two new attributes: CLASS and ID. These new attributes can be applied universally to any HTML tag meant to be displayed within the body of a Web page. This makes sense, since CSS is designed to alter the display of visible elements on a Web page, and by definition that means HTML tags that are displayed within the body of a Web page, and not, say, in the header of a Web page.

The idea behind CLASS and ID is that they identify the HTML tags with which they are associated as "targets" for CSS declarations that have previously been defined within the header of a Web page. CLASS and ID differ in that CLASS is intended for general formatting across many elements on a Web page, whereas ID is meant for specific formatting to a single instance.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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