In previous chapters, you saw how Cascading Style Sheets (CSS) save you time in creating and formatting pages. Using those examples, you learned how to change and create style rules. In this chapter, we go a bit deeper, formatting elements based on their use or context.
You’ll learn to create a variety of styles to cover virtually all your needs. Tag-based styles, also known as element-based styles, apply to a specific HTML element, such as every h1 or li tag. Context-based styles enable you to apply a style when a certain tag appears in a specific context, such as the page’s header or sidebar. Finally, class-based styles