Cascading Style Sheets, level 2
CSS2 Specification
- This version:
- http://www.w3.org/TR/1998/REC-CSS2-19980512
- Latest version:
- http://www.w3.org/TR/REC-CSS2
- Previous version:
- http://www.w3.org/TR/1998/PR-CSS2-19980324
- Editors:
- Bert Bos
<bbos@w3.org>
Håkon Wium Lie <howcome@w3.org>
Chris Lilley <chris@w3.org>
Ian Jacobs <ij@w3.org>
Abstract
This specification defines Cascading Style Sheets, level 2 (CSS2). CSS2 is a style sheet language that allows authors and users to attach style (e.g., fonts, spacing, and aural cues) to structured documents (e.g., HTML documents and XML applications). By separating the presentation style of documents from the content of documents, CSS2 simplifies Web authoring and site maintenance.
CSS2 builds on CSS1 (see [CSS1]) and, with very few exceptions, all valid CSS1 style sheets are valid CSS2 style sheets. CSS2 supports media-specific style sheets so that authors may tailor the presentation of their documents to visual browsers, aural devices, printers, braille devices, handheld devices, etc. This specification also supports content positioning, downloadable fonts, table layout, features for internationalization, automatic counters and numbering, and some properties related to user interface.
Status of this document
This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.
A list of current W3C Recommendations and other technical documents can be found at http://www.w3.org/TR.
Public discussion of CSS features takes place on www-style@w3.org.
Available formats
The CSS2 specification is available in the following formats:
- HTML:
- http://www.w3.org/TR/1998/REC-CSS2-19980512
- a plain text file:
- http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.txt,
- HTML as a gzip'ed tar file:
- http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.tgz,
- HTML as a zip file (this is a '.zip' file not an '.exe'):
- http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.zip,
- as well as a gzip'ed PostScript file:
- http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.ps.gz,
- and a PDF file:
- http://www.w3.org/TR/1998/REC-CSS2-19980512/css2.pdf.
In case of a discrepancy between the various forms of the specification, http://www.w3.org/TR/1998/REC-CSS2-19980512 is considered the definitive version.
Available languages
The English version of this specification is the only normative version. However, for translations in other languages see http://www.w3.org/Style/css2-updates/translations.html.
Errata
The list of known errors in this specification is available at http://www.w3.org/Style/css2-updates/REC-CSS2-19980512-errata.html. Please report errors in this document to css2-editors@w3.org.
Quick Table of Contents
- 1 About the CSS2 Specification
- 2 Introduction to CSS2
- 3 Conformance: Requirements and Recommendations
- 4 CSS2 syntax and basic data types
- 5 Selectors
- 6 Assigning property values, Cascading, and Inheritance
- 7 Media types
- 8 Box model
- 9 Visual formatting model
- 10 Visual formatting model details
- 11 Visual effects
- 12 Generated content, automatic numbering, and lists
- 13 Paged media
- 14 Colors and Backgrounds
- 15 Fonts
- 16 Text
- 17 Tables
- 18 User interface
- 19 Aural style sheets
- Appendix A. A sample style sheet for HTML 4.0
- Appendix B. Changes from CSS1
- Appendix C. Implementation and performance notes for fonts
- Appendix D. The grammar of CSS2
- Appendix E. References
- Appendix F. Property index
- Appendix G. Descriptor index
- Appendix H. Index
Full Table of Contents
- 1 About the CSS2 Specification
- 2 Introduction to CSS2
- 3 Conformance: Requirements and Recommendations
- 4 CSS2 syntax and basic data types
- 5 Selectors
- 6 Assigning property values, Cascading, and Inheritance
- 7 Media types
- 8 Box model
- 8.1 Box dimensions
- 8.2 Example of margins, padding, and borders
- 8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin'
- 8.4 Padding properties: 'padding-top', 'padding-right', 'padding-bottom', 'padding-left', and 'padding'
- 8.5 Border properties
- 8.5.1 Border width: 'border-top-width', 'border-right-width', 'border-bottom-width', 'border-left-width', and 'border-width'
- 8.5.2 Border color: 'border-top-color', 'border-right-color', 'border-bottom-color', 'border-left-color', and 'border-color'
- 8.5.3 Border style: 'border-top-style', 'border-right-style', 'border-bottom-style', 'border-left-style', and 'border-style'
- 8.5.4 Border shorthand properties: 'border-top', 'border-bottom', 'border-right', 'border-left', and 'border'
- 9 Visual formatting model
- 9.1 Introduction to the visual formatting model
- 9.2 Controlling box generation
- 9.3 Positioning schemes
- 9.4 Normal flow
- 9.5 Floats
- 9.6 Absolute positioning
- 9.7 Relationships between 'display', 'position', and 'float'
- 9.8 Comparison of normal flow, floats, and absolute positioning
- 9.9 Layered presentation
- 9.10 Text direction: the 'direction' and 'unicode-bidi' properties
- 10 Visual formatting model details
- 10.1 Definition of "containing block"
- 10.2 Content width: the 'width' property
- 10.3 Computing widths and margins
- 10.3.1 Inline, non-replaced elements
- 10.3.2 Inline, replaced elements
- 10.3.3 Block-level, non-replaced elements in normal flow
- 10.3.4 Block-level, replaced elements in normal flow
- 10.3.5 Floating, non-replaced elements
- 10.3.6 Floating, replaced elements
- 10.3.7 Absolutely positioned, non-replaced elements
- 10.3.8 Absolutely positioned, replaced elements
- 10.4 Minimum and maximum widths: 'min-width' and 'max-width'
- 10.5 Content height: the 'height' property
- 10.6 Computing heights and margins
- 10.6.1 Inline, non-replaced elements
- 10.6.2 Inline, replaced elements block-level, replaced elements in normal flow, and floating, replaced elements
- 10.6.3 Block-level, non-replaced elements in normal flow, and floating, non-replaced elements
- 10.6.4 Absolutely positioned, non-replaced elements
- 10.6.5 Absolutely positioned, replaced elements
- 10.7 Minimum and maximum heights: 'min-height' and 'max-height'
- 10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
- 11 Visual effects
- 12 Generated content, automatic numbering, and lists
- 13 Paged media
- 14 Colors and Backgrounds
- 15 Fonts
- 15.1 Introduction
- 15.2 Font specification
- 15.2.1 Font specification properties
- 15.2.2 Font family: the 'font-family' property
- 15.2.3 Font styling: the 'font-style', 'font-variant', 'font-weight' and 'font-stretch' properties
- 15.2.4 Font size: the 'font-size' and 'font-size-adjust' properties
- 15.2.5 Shorthand font property: the 'font' property
- 15.2.6 Generic font families
- 15.3 Font selection
- 15.3.1 Font Descriptions and @font-face
- 15.3.2 Descriptors for Selecting a Font: 'font-family', 'font-style', 'font-variant', 'font-weight', 'font-stretch' and 'font-size'
- 15.3.3 Descriptors for Font Data Qualification: 'unicode-range'
- 15.3.4 Descriptor for Numeric Values: 'units-per-em'
- 15.3.5 Descriptor for Referencing: 'src'
- 15.3.6 Descriptors for Matching: 'panose-1', 'stemv', 'stemh', 'slope', 'cap-height', 'x-height', 'ascent', and 'descent'
- 15.3.7 Descriptors for Synthesis: 'widths', 'bbox' and 'definition-src'
- 15.3.8 Descriptors for Alignment: 'baseline', 'centerline', 'mathline', and 'topline'
- 15.3.9 Examples
- 15.4 Font Characteristics
- 15.4.1 Introducing Font Characteristics
- 15.4.2 Full font name
- 15.4.3 Coordinate units on the em square
- 15.4.4 Central Baseline
- 15.4.5 Font Encoding
- 15.4.6 Font family name
- 15.4.7 Glyph widths
- 15.4.8 Horizontal stem width
- 15.4.9 Height of uppercase glyphs
- 15.4.10 Height of lowercase glyphs
- 15.4.11 Lower Baseline
- 15.4.12 Mathematical Baseline
- 15.4.13 Maximal bounding box
- 15.4.14 Maximum unaccented height
- 15.4.15 Maximum unaccented depth
- 15.4.16 Panose-1 number
- 15.4.17 Range of ISO 10646 characters
- 15.4.18 Top Baseline
- 15.4.19 Vertical stem width
- 15.4.20 Vertical stroke angle
- 15.5 Font matching algorithm
- 16 Text
- 17 Tables
- 18 User interface
- 19 Aural style sheets
- 19.1 Introduction to aural style sheets
- 19.2 Volume properties: 'volume'
- 19.3 Speaking properties: 'speak'
- 19.4 Pause properties: 'pause-before', 'pause-after', and 'pause'
- 19.5 Cue properties: 'cue-before', 'cue-after', and 'cue'
- 19.6 Mixing properties: 'play-during'
- 19.7 Spatial properties: 'azimuth' and 'elevation'
- 19.8 Voice characteristic properties: 'speech-rate', 'voice-family', 'pitch', 'pitch-range', 'stress', and 'richness'
- 19.9 Speech properties: 'speak-punctuation' and 'speak-numeral'
- Appendix A. A sample style sheet for HTML 4.0
- Appendix B. Changes from CSS1
- Appendix C. Implementation and performance notes for fonts
- Appendix D. The grammar of CSS2
- Appendix E. References
- Appendix F. Property index
- Appendix G. Descriptor index
- Appendix H. Index
Document created the 04/02/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/css.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.