© Andy Budd and Emil Bjorklund 2016

Andy Budd and Emil Björklund, CSS Mastery, 10.1007/978-1-4302-5864-3_2

2. Getting Your Styles to Hit the Target

Andy Budd and Emil Björklund2

(1)Brighton, UK

(2)Malmo, Sweden

A valid and well-structured document provides the foundation to which your styles are applied. You may already have added appropriate styling “hooks” to your HTML, or you may return to add more as the design requirements for a page evolve. In this chapter we will look at the range of selectors we have available to target that HTML and the extra hooks we can use to gain more control. We’ll cover:

  • Common selectors

  • Bleeding-edge selectors for now and the future

  • The wonderful world of specificity and the cascade

  • Applying styles to your pages

CSS Selectors ...

Get CSS Mastery, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.