CSS.pdf
(
1558 KB
)
Pobierz
Cascading Style Sheets, Level 2
REC-CSS2-19980512
Cascading Style Sheets, level 2
CSS2 Specification
W3C Recommendation 12-May-1998
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 refer-
ence 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.
1
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.
2
Quick Table of Contents
1 About the CSS2 Specification
.
.
.
.
.
.
.
.
.
.
13
.
2 Introduction to CSS2
.
.
.
.
.
.
.
.
.
.
.
.
21
.
3 Conformance: Requirements and Recommendations
.
.
.
.
29
.
4 CSS2 syntax and basic data types
.
.
.
.
.
.
.
.
.
35
5 Selectors
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
53
6 Assigning property values, Cascading, and Inheritance
.
.
.
.
69
7 Media types
.
.
.
.
.
.
.
.
.
.
.
.
.
.
77
8 Box model
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
81
9 Visual formatting model
.
.
.
.
.
.
.
.
.
.
.
95
10 Visual formatting model details
.
.
.
.
.
.
.
.
.
131
11 Visual effects
.
.
.
.
.
.
.
.
.
.
.
.
.
.
145
12 Generated content, automatic numbering, and lists
.
.
.
.
153
13 Paged media
.
.
.
.
.
.
.
.
.
.
.
.
.
.
175
14 Colors and Backgrounds
.
.
.
.
.
.
.
.
.
.
.
187
15 Fonts
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
195
16 Text
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
237
17 Tables
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
245
18 User interface
.
.
.
.
.
.
.
.
.
.
.
.
.
271
19 Aural style sheets
.
.
.
.
.
.
.
.
.
.
.
.
.
277
Appendix A. A sample style sheet for HTML 4.0
.
.
.
.
.
.
291
Appendix B. Changes from CSS1
.
.
.
.
.
.
.
.
.
293
Appendix C. Implementation and performance notes for fonts
.
.
.
295
Appendix D. The grammar of CSS2
.
.
.
.
.
.
.
.
.
309
Appendix E. References
.
.
.
.
.
.
.
.
.
.
.
.
313
Appendix F. Property index
.
.
.
.
.
.
.
.
.
.
.
317
Appendix G. Descriptor index
.
.
.
.
.
.
.
.
.
.
323
Appendix H. Index
.
.
.
.
.
.
.
.
.
.
.
.
.
325
3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Full Table of Contents
1 About the CSS2 Specification
.
.
.
.
.
.
.
.
.
.
13
.
1.1 Reading the specification
.
.
.
.
.
.
.
.
.
13
.
1.2 How the specification is organized
.
.
.
.
.
.
.
13
.
1.3 Conventions
.
.
.
.
.
.
.
.
.
.
.
.
.
14
1.3.1 Document language elements and attributes
.
.
.
14
1.3.2 CSS property definitions
.
.
.
.
.
.
.
.
14
Value
.
.
.
.
.
.
.
.
.
.
.
.
.
14
Initial
.
.
.
.
.
.
.
.
.
.
.
.
.
16
Applies to
.
.
.
.
.
.
.
.
.
.
.
.
16
Inherited
.
.
.
.
.
.
.
.
.
.
.
.
16
Percentage values
.
.
.
.
.
.
.
.
.
.
16
Media groups
.
.
.
.
.
.
.
.
.
.
.
16
1.3.3 Shorthand properties
.
.
.
.
.
.
.
.
.
16
1.3.4 Notes and examples
.
.
.
.
.
.
.
.
.
17
1.3.5 Images and long descriptions
.
.
.
.
.
.
.
17
1.4 Acknowledgments
.
.
.
.
.
.
.
.
.
.
.
17
1.5 Copyright Notice
.
.
.
.
.
.
.
.
.
.
.
.
18
2 Introduction to CSS2
.
.
.
.
.
.
.
.
.
.
.
.
21
2.1 A brief CSS2 tutorial for HTML
.
.
.
.
.
.
.
.
21
2.2 A brief CSS2 tutorial for XML
.
.
.
.
.
.
.
.
.
23
2.3 The CSS2 processing model
.
.
.
.
.
.
.
.
.
25
2.3.1 The canvas
.
.
.
.
.
.
.
.
.
.
.
26
2.3.2 CSS2 addressing model
.
.
.
.
.
.
.
.
26
2.4 CSS design principles
.
.
.
.
.
.
.
.
.
.
26
3 Conformance: Requirements and Recommendations
.
.
.
.
29
3.1 Definitions
.
.
.
.
.
.
.
.
.
.
.
.
.
29
3.2 Conformance
.
.
.
.
.
.
.
.
.
.
.
.
32
3.3 Error conditions
.
.
.
.
.
.
.
.
.
.
.
.
32
3.4 The text/css content type
.
.
.
.
.
.
.
.
.
33
4 CSS2 syntax and basic data types
.
.
.
.
.
.
.
.
.
35
4.1 Syntax
.
.
.
.
.
.
.
.
.
.
.
.
.
.
35
4.1.1 Tokenization
.
.
.
.
.
.
.
.
.
.
.
35
4.1.2 Keywords
.
.
.
.
.
.
.
.
.
.
.
.
38
4.1.3 Characters and case
.
.
.
.
.
.
.
.
.
38
4.1.4 Statements
.
.
.
.
.
.
.
.
.
.
.
39
4.1.5 At-rules
.
.
.
.
.
.
.
.
.
.
.
.
39
4.1.6 Blocks
.
.
.
.
.
.
.
.
.
.
.
.
40
4.1.7 Rule sets, declaration blocks, and selectors
.
.
.
40
4.1.8 Declarations and properties
.
.
.
.
.
.
.
41
4.1.9 Comments
.
.
.
.
.
.
.
.
.
.
.
42
4.2 Rules for handling parsing errors
.
.
.
.
.
.
.
.
42
4.3 Values
.
.
.
.
.
.
.
.
.
.
.
.
.
.
43
4.3.1 Integers and real numbers
.
.
.
.
.
.
.
.
43
4.3.2 Lengths
.
.
.
.
.
.
.
.
.
.
.
.
43
4.3.3 Percentages
.
.
.
.
.
.
.
.
.
.
.
46
4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4.3.4 URL + URN = URI
.
.
.
.
.
.
.
.
.
.
46
.
4.3.5 Counters
.
.
.
.
.
.
.
.
.
.
.
.
47
.
4.3.6 Colors
.
.
.
.
.
.
.
.
.
.
.
.
48
.
4.3.7 Angles
.
.
.
.
.
.
.
.
.
.
.
.
49
.
4.3.8 Times
.
.
.
.
.
.
.
.
.
.
.
.
.
49
.
4.3.9 Frequencies
.
.
.
.
.
.
.
.
.
.
.
50
.
4.3.10 Strings
.
.
.
.
.
.
.
.
.
.
.
.
50
.
4.4 CSS document representation
4.4.1 Referring to characters not represented in a character encod-
.
.
.
.
.
.
.
.
.
50
.
ing
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
51
5 Selectors
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
53
.
5.1 Pattern matching
.
.
.
.
.
.
.
.
.
.
.
53
.
5.2 Selector syntax
.
.
.
.
.
.
.
.
.
.
.
.
55
5.2.1 Grouping
.
.
.
.
.
.
.
.
.
.
.
.
55
5.3 Universal selector
.
.
.
.
.
.
.
.
.
.
.
55
5.4 Type selectors
.
.
.
.
.
.
.
.
.
.
.
.
56
5.5 Descendant selectors
.
.
.
.
.
.
.
.
.
.
56
5.6 Child selectors
.
.
.
.
.
.
.
.
.
.
.
.
57
5.7 Adjacent sibling selectors
.
.
.
.
.
.
.
.
.
57
5.8 Attribute selectors
.
.
.
.
.
.
.
.
.
.
.
57
5.8.1 Matching attributes and attribute values
.
.
.
.
58
5.8.2 Default attribute values in DTDs
.
.
.
.
.
.
59
5.8.3 Class selectors
.
.
.
.
.
.
.
.
.
.
59
5.9 ID selectors
.
.
.
.
.
.
.
.
.
.
.
.
.
60
5.10 Pseudo-elements and pseudo-classes
.
.
.
.
.
.
61
5.11 Pseudo-classes
.
.
.
.
.
.
.
.
.
.
.
62
5.11.1 :first-child pseudo-class
.
.
.
.
.
.
.
.
62
5.11.2 The link pseudo-classes: :link and :visited
.
.
.
.
63
5.11.3 The dynamic pseudo-classes: :hover, :active, and :focus
63
5.11.4 The language pseudo-class: :lang
.
.
.
.
.
65
5.12 Pseudo-elements
.
.
.
.
.
.
.
.
.
.
.
65
5.12.1 The :first-line pseudo-element
.
.
.
.
.
.
65
5.12.2 The :first-letter pseudo-element
.
.
.
.
.
.
66
5.12.3 The :before and :after pseudo-elements
.
.
.
.
68
6 Assigning property values, Cascading, and Inheritance
.
.
.
.
69
6.1 Specified, computed, and actual values
.
.
.
.
.
.
69
6.1.1 Specified values
.
.
.
.
.
.
.
.
.
.
69
6.1.2 Computed values
.
.
.
.
.
.
.
.
.
.
70
6.1.3 Actual values
.
.
.
.
.
.
.
.
.
.
.
70
6.2 Inheritance
.
.
.
.
.
.
.
.
.
.
.
.
.
70
6.2.1 The ’inherit’ value
.
.
.
.
.
.
.
.
.
.
71
6.3 The @import rule
.
.
.
.
.
.
.
.
.
.
.
71
6.4 The cascade
.
.
.
.
.
.
.
.
.
.
.
.
72
6.4.1 Cascading order
.
.
.
.
.
.
.
.
.
.
73
6.4.2 !important rules
.
.
.
.
.
.
.
.
.
.
73
6.4.3 Calculating a selector’s specificity
.
.
.
.
.
.
74
6.4.4 Precedence of non-CSS presentational hints
.
.
.
74
5
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Plik z chomika:
LisiaLu
Inne pliki z tego folderu:
Programuje_w_Delphi_i_C___Builder_cz._II.pdf
(1132 KB)
Dieta_surowa,_ktora_jest..._smaczna!.pdf
(1031 KB)
Gry_i_zabawy_Jezyk_angielski_Hello!_Poznajmy_sie!_-_ebook.pdf
(1143 KB)
Ekspresowy_kurs_dla_poczatkujacych._Angielski.pdf
(1081 KB)
365_zadan_i_cwiczen_z_rozwiazaniami._Jezyk_angielski.pdf
(1272 KB)
Inne foldery tego chomika:
► WYCHOWANIE PSA
►Wnętrza mieszkań
◄●► PORADY BABUNI ◄●►
۩ § Porady Prawne-POLECAM § ۩
018 Hipnoza(1)
Zgłoś jeśli
naruszono regulamin