O'Reilly logo

Hello! HTML5 & CSS3: A user-friendly reference guide by Rob Crowther

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

Appendix C. CSS basics

If you’ve just read appendix B, you’re probably wondering how those rather dull textual examples end up looking like the beautiful web pages you see every day. The answer isn’t some secret extra markup you didn’t learn about yet, but Cascading Style Sheets (CSS). This appendix will introduce the main features of CSS, including

  • The basic syntax of CSS
  • Using CSS selectors to apply styles only to certain elements
  • The most common properties and values
  • Using CSS for layout

Rules, selectors, properties, and values

A CSS style sheet is made up of rules. Here are three example CSS rules.

A CSS rule is made up of a selector ...

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