Sams Teach Yourself CSS in 24 Hours- P3: Times have changed, thankfully, since those Dark Ages of CSS. All major browsers as well as some minor ones have increased support for Cascading Style Sheets in the latest versions. Web developers are aware of CSS and the vital role they play in designing great Web pages, and presumably you’ve got some idea of how important they are if you’ve bought this book. | 82 Hour 5 So far you have learned how to create CSS rules using simple selectors type selectors based on the HTML tag and class or id selectors based on attributes in the HTML. A type selector is simply the name of an HTML tag minus the angle brackets. For example hi color blue This selects all hl tags and specifies that they re the color blue. Type selectors are the easiest to use because they re so straightforward but they re also very limited. What if you want only some of the hl tags to be blue and others to be green That s when you d use class and id selectors. Although I said type selectors had to be HTML tags I must admit that s only half true. They actually have to be any sort of legitimate element for the language you re styling this is how you can use CSS with XML for example. And in fact you don t have to have the actual tag present HTML but not XML or XHTML lets you leave out certain tag declarations entirely such as the body element. The opening and closing tags are implied. If you have a rule based on body such as body font-family Arial a CSS-compliant browser will still apply your font to the implied body even though no tags are present. In Hour 4 Using CSS with HTML you learned how you can set class and id selectors in your rules based on HTML attributes of class and id such as here font-size large .there color green An id selector uniquely identifies part of a page whereas a class selector allows you to identify specific tags as being part of a certain set you ve defined. Using class and id Selectors You can combine class selectors or even id selectors with div tags to designate specific sections of a page that should receive special styling. For example consider the HTML page shown in Listing which has a class attribute set on each div tag. Selectors 83 Listing HTML Sections Set via div and class -- -- -- Accessibility tips for images -- -- By Kynn Bartlett kynn@ -- html head title Image Accessibility title link .