7 Learning More About Styles

 

This chapter covers

  • Learning the three methods for adding styles to a web page
  • Adding power and flexibility with classes
  • Understanding the units of measurement you can use in your CSS

How do you craft pages that rise above the humdrum? How do you design pages that go beyond the same old, same old? One word: styles. If you’ve seen a well-designed web page, know that the page uses styles to achieve that look. If there’s a web designer whose work you admire, know that the designer mastered styles that make her work stand out. You saw several useful styles in Part 1 of the book, but those styles are only a taste of what’s out there. To help you get started down the road to becoming truly style savvy, this chapter takes your style knowledge to the next level.

Adding Styles to a Page

I mentioned in Chapter 1 that a web page is a text file filled with words, numbers, and a few strategically placed HTML tags that provide structure for the text. You’ll be happy to hear that CSS is also a text-based business, so you don’t need anything grander than a simple text editor (or this book’s handy Web Design Playground) to get started with styles.

Remember

A style is an instruction to the browser to modify how it displays something on the page, and a style sheet (the SS part of CSS) is a collection of styles. So, throughout this book, I use the terms CSS and styles interchangeably.

Lesson 7.1:   Inserting Inline Styles

Lesson 7.2:   Adding an Internal Style Sheet

Lesson 7.3:   Referencing an External Style Sheet

Lesson 7.4:   Using Class Selectors

Units of Measurement in CSS

Summary