4 CSS 1: Selectors and Basic Styling

Chapter Objectives

In this chapter you will learn . . .

This chapter provides a substantial introduction to CSS (Cascading Style Sheets), the principal mechanism for web authors to modify the visual presentation of their web pages. Just as with HTML, there are many books and websites devoted to CSS.14 While simple styling is quite straightforward, more advanced CSS tasks such as layout and positioning can be quite complicated, which is why we’ve put those items in the next chapter. Since this book covers CSS in just two chapters, it cannot possibly cover all of it. Instead, our intent in this chapter is to cover the foundations necessary for working with contemporary CSS; Chapter 7 will cover CSS layout and positioning.