O'Reilly logo

Sams Teach Yourself CSS 24 in Hours by Kynn Bartlett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Advanced Selectors

<feature><title>What You’ll Learn in This Hour:</title>
  • How to create CSS rules that select only those tags that have a specific attribute

  • How to create rules based on the values of those attributes

  • How to create rules that select direct children of another element and why you’d want to do that

  • How to select an element that directly follows another element

</feature>

Attribute Selectors

An attribute selector tests for the existence, and possibly the values, of any specific HTML attributes set on an element. You’d use an attribute selector if you wanted all elements with a certain attribute to be styled a certain way. For example, noshade is an HTML attribute for the <hr> tag; it means that there shouldn’t be any shading ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required