Learn more with dummies

Enter your email to join our mailing list for FREE content right to your inbox. Easy!

The Anatomy of Cascading Style Sheets (CSS)

By Sue Jenkins

Part of Web Design All-in-One For Dummies Cheat Sheet

Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics — the style and positioning — of elements within a web document written in a simple markup language.

CSS syntax is made up of two parts: the selector and the declaration block inside curly brackets. Inside the declaration block you can have multiple declarations. Each declaration is made of two parts — the property and the value:

p {font-face: Georgia, Tahoma; color: #ffcc00; }

In this example:

  • p is the selector.

  • {font-face: Georgia, Tahoma; color: #ffcc00; } is the declaration block.

  • font-face: Georgia, Tahoma; and color: #ffcc00; are separate declarations.

  • font-face is a property and Georgia, Tahoma is its value.

  • color is a second property and #ffcc00; is its value.