Next / Previous / Contents / TCC Help System / NM Tech homepage

Abstract

Reference guide for Cascading Style Sheets 2.0, a language for describing the style of Web pages.

This publication is available in Web form and also as a PDF document. Please forward any comments to tcc-doc@nmt.edu.

Table of Contents

1. What are Cascading Style Sheets and why should you use them?
2. Connecting your page to a style sheet
3. Overall structure of a style sheet
4. At-rules
5. How to write CSS rules
6. Common value types in CSS
6.1. Dimensions
6.2. Specifying colors
6.3. String constants
6.4. Universal resource identifiers (URIs)
6.5. Counters
6.6. Specifying angles
6.7. Times
6.8. Frequencies
7. Selectors
7.1. Element type selectors
7.2. Selecting elements by class
7.3. Selecting elements by their context
7.4. Child selection
7.5. Adjacent element selection
7.6. Selecting by attribute values
7.7. Selecting specific single elements by ID
7.8. Pseudo-classes
7.9. Pseudo-elements
7.10. The universal selector
8. When rules collide
8.1. Cascading
8.2. Specificity: Which selector applies?
8.3. Inheritance
9. Declarations
10. Font properties
10.1. The font-family property
10.2. The font-style property
10.3. The font-variant property
10.4. The font-weight property
10.5. The font-size property
10.6. The font property
11. The display property: What kind of box is this?
12. Other text properties
12.1. The line-height property
12.2. The text-indent property
12.3. The text-align property
12.4. The text-decoration property
12.5. The text-transform property
12.6. The white-space property
12.7. The letter-spacing property
12.8. The word-spacing property
12.9. The vertical-align property: Shifting the baseline
12.10. The quotes property: Specifying quote characters
13. The color property
14. The background properties
15. Designing with box elements
15.1. Side lists
15.2. The height and width properties
15.3. The clear property
15.4. The float property
15.5. The padding properties
15.6. The border properties
15.7. The margin properties
15.8. The overflow property: What if it doesn't fit?
15.9. The clip property: Specify a clipping rectangle
15.10. The visibility property: Can we see the content?
15.11. The position property: Positioning boxes
15.12. The box offset properties: top, bottom, left, and right
15.13. The z-index property: Stacking order
16. The content property: Specifying content in pseudo-elements
16.1. The counter-reset property
16.2. The counter-increment property
17. The list properties
17.1. The list-style-type property
17.2. The list-style-image property
17.3. The list-style-position property
17.4. The list-style property
17.5. The marker-offset property
18. Tables
18.1. Table column properties
18.2. How table size is computed
18.3. Table border properties
18.4. The speak-header property: Aural rendering of tables
19. User interface options
19.1. The cursor property
19.2. Selecting colors to match UI components
19.3. Dynamic outlines
20. Aural stylesheets
20.1. Spatial presentation: the azimuth property
20.2. Voice properties
20.3. The volume property
20.4. The speak, speak-punctuation , and speak-numeral properties: spelling it out
20.5. General voice qualities: voice-family, pitch, pitch-range, stress, and richness
20.6. Timing properties: speech-rate, pause-before, pause-after, and pause
20.7. Element cues: cue-before, cue-after, and cue
20.8. Audio mixing: play-during
21. The @import rule: Importing another stylesheet
22. The @media rule: Tuning for different rendering platforms
22.1. Media types
23. The @page rule: Paged media
23.1. The size property for paged media
23.2. Controlling page breaks
23.3. Orphan control
23.4. Widow control
23.5. Crop marks and alignment targets: the marks property
23.6. The page attribute: Selecting a page type

1. What are Cascading Style Sheets and why should you use them?

HTML (HyperText Markup Language), the language of Web pages, describes the function of each element of your page, but the browser determines how each element will actually look. This has frustrated page designers who want more creative control of appearance.

The Cascading Style Sheet (CSS) standard gives you this creative control, assuming that the reader has a relatively recent Web browser. Most modern browsers support most or all of CSS level 2.1.

CSS is most commonly used to mark up HTML web pages. However, it can also be used to display XML documents.

Useful online resources: