📄 changes.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en"><HEAD><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><TITLE>Appendix B: Changes from CSS1</TITLE><link rel="stylesheet" href="style/default.css" type="text/css"><link rel="prev" href="sample.html"><link rel="next" href="notes.html"><link rel="contents" href="cover.html#minitoc"><link rel="CSS-properties" href="propidx.html" title="properties"><link rel="index" href="indexlist.html" title="index"></HEAD><BODY><div class="navbar" align="center"><p><a href="sample.html">previous</a> <a href="notes.html">next</a> <a href="cover.html#minitoc">contents</a> <a href="propidx.html">properties</a> <a href="indexlist.html">index</a> </div><hr class="navbar"><H1 align="center">Appendix B. Changes from CSS1</H1><div class="subtoc"><p><strong>Contents</strong> <ul class="toc"> <li class="tocline2"><a href="changes.html#q1" class="tocxref">B.1 New functionality</a> <li class="tocline2"><a href="changes.html#q2" class="tocxref">B.2 Updated descriptions</a> <li class="tocline2"><a href="changes.html#changes-from-css1" class="tocxref">B.3 Semantic changes from CSS1</a> </ul></div><P><em>This appendix is informative, not normative.</em></P><P>CSS2 builds on CSS1 and all valid CSS1 style sheets are valid CSS2style sheets. The changes between the CSS1 specification (see<a href="refs.html#ref-CSS1" rel="biblioentry" class="noxref"><span class="normref">[CSS1]</span></a>) and this specification fall into three groups: newfunctionality, updated descriptions of CSS1 functionality, and changesto CSS1.<H2><a name="q1">B.1 New functionality</a></H2><P>In addition to the functionality of CSS1, CSS2 supports:</p><UL><LI>The concept of <A HREF="media.html">media types</A>.<LI>The <a href="cascade.html#value-def-inherit">'inherit'</a> value for all properties.<LI><A HREF="page.html">Paged media</A><LI><A HREF="aural.html">Aural style sheets</A><LI>Several internationalization features, including <ahref="generate.html#lists">list numbering styles</a>, support for <ahref="visuren.html#direction">bidirectional text</a>, and support forlanguage-sensitive <a href="generate.html#quotes">quotationmarks</a>.<LI><A HREF="fonts.html#font-selection">An extended font selection</A>mechanism, including intelligent matching, synthesis, and downloadablefonts. Also, the concept of system fonts has been is introduced, and anew property, <a href="fonts.html#propdef-font-size-adjust" class="noxref"><spanclass="propinst-font-size-adjust">'font-size-adjust'</span></a>, has been added.<LI><A HREF="tables.html">Tables</A>, including new values on <a href="visuren.html#propdef-display" class="noxref"><spanclass="propinst-display">'display'</span></a> and <a href="visudet.html#propdef-vertical-align" class="noxref"><spanclass="propinst-vertical-align">'vertical-align'</span></a>.<LI><A HREF="visuren.html#relative-positioning">Relative</A> and <AHREF="visuren.html#absolute-positioning">absolute positioning</A>,including <A HREF="visuren.html#fixed-positioning">fixedpositioning</A>.<LI>New box types (along with block and inline): <ahref="visuren.html#compact">compact</a> and <a href="visuren.html#run-in">run-in</a>.<LI>The ability to control content <ahref="visufx.html#overflow">overflow</a>, <ahref="visufx.html#clipping">clipping</a>, and <ahref="visufx.html#visibility">visibility</a> in the visual formattingmodel.<LI>The ability to specify minimum and maximum <ahref="visudet.html#min-max-widths">widths</a> and <ahref="visudet.html#min-max-heights">heights</a> in the visualformatting model.<LI>An extended <A HREF="selector.html">selector</A> mechanism,including child selectors, adjacent selectors, and attribute selectors.<LI><A HREF="generate.html#generated-text">Generated content</a>,<a href="generate.html#counters">counters and automatic numbering</A>, and<a href="generate.html#markers">markers</a>.<LI>Text shadows, through the new <a href="text.html#propdef-text-shadow" class="noxref"><spanclass="propinst-text-shadow">'text-shadow'</span></a> property.<LI>Several new <AHREF="selector.html#pseudo-classes">pseudo-classes</A>, :first-child, :hover,:focus, :lang.<LI>System <A HREF="ui.html#system-colors">colors</A> and <A href="ui.html#system-fonts">fonts</a>.<LI><A href="ui.html#cursor-props">Cursors</a>.<LI><A href="ui.html#dynamic-outlines">Dynamic outlines</a>.</UL><H2><a name="q2">B.2 Updated descriptions</a></H2><P>The CSS1 specification was short and concise. This specification ismuch more voluminous and more readable. Much of the additional contentdescribes new functionality, but the description of CSS1 features hasalso been extended. Except in a few cases described below, therewritten descriptions do not indicate a change in syntax norsemantics. <H2>B.3 <a name="changes-from-css1">Semantic changes from CSS1</a></H2><P>While all CSS1 style sheets are valid CSS2 style sheets, there area few cases where the CSS1 style sheet will have a different meaningwhen interpreted as a CSS2 style sheet. Most changes are due toimplementation experience feeding back into the specification, butthere are also some error corrections.<UL><LI>The meaning of "!important" has been changed. In CSS1,"!important" in an author's style sheet took precedence overone in a user style sheet. This has been reversed in CSS2.<LI>In CSS2 <A HREF="syndata.html#color-units">color values</A> are clippedwith regard to the device gamut, not with regard to the sRGB gamut asin CSS1.<LI>CSS1 simply said that 'margin-right' was ignored if the both'margin-left' and 'width' were set. In CSS2 the choice betweenrelaxing 'margin-right' or 'margin-left' depends on the writing direction.<LI>In CSS1, several properties (e.g., 'padding') had values referringto the width of the parent element. This was an error; the valueshould always refer to the width of a block-level element and thisspecification reflects this by introducing the term "containing block".<LI>The initial value of 'display' is 'inline' in CSS2, not 'block' asin CSS1.<LI>In CSS1, the 'clear' property applied to all elements. This was anerror, and the property only applies to block-level elements in CSS2.<LI>In CSS1, <a name="x0"><span class="index-inst"title="pseudo-classes:::link|:link|link(pseudo-class)">':link'</span></a>, <a name="x3"><span class="index-inst"title="pseudo-classes:::visited|:visited|visited(pseudo-class)">':visited'</span></a> and <a name="x6"><span class="index-inst"title="pseudo-classes:::active|:active|active(pseudo-class)">':active'</span></a> were mutually exclusive; in CSS2, <ahref="selector.html#dynamic-pseudo-classes">':active'</a> can occurtogether with <a href="selector.html#link-pseudo-classes">':link' or':visited'</a>.<LI>The suggested scaling factor between adjacent <a href="fonts.html#propdef-font-size" class="noxref"><spanclass="propinst-font-size">'font-size'</span></a> indexes in the table of fontsizes has been reduced from 1.5 to 1.2.<LI>The computed value, not the actual value, of <a href="fonts.html#propdef-font-size" class="noxref"><spanclass="propinst-font-size">'font-size'</span></a> is inherited.<LI>The CSS1 description of 'inside' (for <a href="generate.html#propdef-list-style-position" class="noxref"><spanclass="propinst-list-style-position">'list-style-position'</span></a>)allowed the interpretation that the left margin of the text wasaffected, rather than the position of the bullet. In CSS2 thatinterpretation is ruled out.<li>Please also consult the <em>normative</em> section on the <ahref="grammar.html#tokenizer-diffs">differences between the CSS1 andCSS2 tokenizer</a>.</UL><hr class="navbar"><div class="navbar" align="center"><p><a href="sample.html">previous</a> <a href="notes.html">next</a> <a href="cover.html#minitoc">contents</a> <a href="propidx.html">properties</a> <a href="indexlist.html">index</a> </div></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -