8000 csswg-drafts/css2/generate.src at 2a797fe75e55423158e80d97668cd8d09b0bc3ec · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
1096 lines (881 loc) · 39 KB

File metadata and controls

1096 lines (881 loc) · 39 KB
the value 'none' or if the image pointed to by the URI cannot be
displayed. The value 'none' specifies no marker, otherwise there are
three types of marker: glyphs, numbering systems, and alphabetic
systems.
<P>Glyphs are specified with
<strong><span class="index-def" title="disc"><a class="value-def"
name="value-def-disc">disc</a></span></strong>,
<strong><span class="index-def" title="circle"><a class="value-def"
name="value-def-circle">circle</a></span></strong>, and
<strong><span class="index-def" title="square"><a class="value-def"
name="value-def-square">square</a></span></strong>. Their exact
rendering depends on the user agent.
<P>Numbering systems are specified with:</P>
<dl>
<dt><span class="index-def" title="decimal"><a class="value-def" name="value-def-decimal"><strong>decimal</strong></a></span><dd>Decimal numbers, beginning with 1.
<dt><strong><span class="index-def" title="decimal-leading-zero"><a class="value-def" name="value-def-decimal-leading-zero">decimal-leading-zero</a></span></strong>
<dd>Decimal numbers padded by initial zeros (e.g., 01, 02, 03, ..., 98, 99).
<!-- should this be included -->
<dt><strong><span class="index-def" title="lower-roman"><a class="value-def" name="value-def-lower-roman">lower-roman</a></span></strong>
<dd>Lowercase roman numerals (i, ii, iii, iv, v, etc.).
<dt><strong><span class="index-def" title="upper-roman"><a class="value-def" name="value-def-upper-roman">upper-roman</a></span></strong>
<dd>Uppercase roman numerals (I, II, III, IV, V, etc.).
<dt><strong><span class="index-def" title="georgian"><a class="value-def" name="value-def-georgian">georgian</a></span></strong>
<dd>Traditional Georgian numbering
(an, ban, gan, ..., he, tan, in, in-an, ...).
<dt><strong><span class="index-def" title="armenian"><a class="value-def" name="value-def-armenian">armenian</a></span></strong>
<dd>Traditional uppercase Armenian numbering.
</dl>
<P>Alphabetic systems are specified with:</P>
<dl>
<dt><strong><span class="index-def" title="lower-latin"><a class="value-def" name="value-def-lower-latin">lower-latin</a></span></strong> or <strong>lower-alpha</strong>
<dd>Lowercase ascii letters (a, b, c, ... z).
<dt><strong><span class="index-def" title="upper-latin"><a class="value-def" name="value-def-upper-latin">upper-latin</a></span></strong> or <strong>upper-alpha</strong>
<dd>Uppercase ascii letters (A, B, C, ... Z).
<dt><strong><span class="index-def" title="lower-greek"><a class="value-def" name="value-def-lower-greek">lower-greek</a></span></strong>
<dd>Lowercase classical Greek
alpha, beta, gamma, ... (&#945;, &#946;, &#947;, ...)
</dl>
<P>This specification does not define how alphabetic systems wrap at
the end of the alphabet. For instance, after 26 list items,
'lower-latin' rendering is undefined. Therefore, for long lists, we
recommend that authors specify true numbers.
<p>CSS&nbsp;2.1 does not define how the list numbering is reset and
incremented. This is expected to be defined in the CSS List Module
[[CSS3LIST]].
<div class="html-example"><P>
For example, the following HTML document:
<PRE>
&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"&gt;
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Lowercase latin numbering&lt;/TITLE&gt;
&lt;STYLE type="text/css"&gt;
ol { list-style-type: lower-roman }
&lt;/STYLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;OL&gt;
&lt;LI&gt; This is the first item.
&lt;LI&gt; This is the second item.
&lt;LI&gt; This is the third item.
&lt;/OL&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</PRE>
<P>might produce something like this:
<PRE>
i This is the first item.
ii This is the second item.
iii This is the third item.
</PRE>
<P>The list marker alignment (here, right justified) depends on the user agent.
</div>
<!-- #include src=properties/list-style-image.srb -->
<P> This property sets the image that will be used as the list item
marker. When the image is available, it will replace the marker set
with the <span
class="propinst-list-style-type">'list-style-type'</span> marker.
<p>The size of the image is calculated from the following rules:
<ol>
<li>If the image has an intrinsic width and height, the used width and
height are the intrinsic width and height.
<li>Otherwise, if the image has an intrinsic ratio and either an
intrinsic width or an intrinsic height, the used width/height is the
same as the provided intrinsic width/height, and the used value of the
missing dimension is calculated from the provided dimension and the
ratio.
<li>Otherwise, if the image has an intrinsic ratio, the used width is
1em and the used height is calculated from this width and the
intrinsic ratio. If this would produce a height larger than 1em, then
the used height is instead set to 1em and the used width is calculated
from this height and the intrinsic ratio.
<li>Otherwise, the image's used width is its intrinsic width if it has
one, or else 1em. The image's used height is its intrinsic height if
it has one, or else 1em.
</ol>
<div class="example"><P>
The following example sets the marker at the beginning of each list
item to be the image "ellipse.png".
<PRE>
ul { list-style-image: url("http://png.com/ellipse.png") }
</PRE>
</div>
<!-- #include src=properties/list-style-position.srb -->
<P> This property specifies the position of the marker box with
respect to the
principal block box. Values have the following meanings:</p>
<dl>
<dt><strong>outside</strong>
<dd>The marker box is outside the principal block box. <!--86-->The
position of the list-item marker adjacent to floats is undefined in
CSS&nbsp;2.1.<!--/86--> CSS&nbsp;2.1 does not specify the precise
location of the marker box <!--191-->or its position in the painting
order<!--/191-->, but does
require that for list items whose 'direction' property is 'ltr' the
marker box be on the left side of the content and for elements whose
'direction' property is 'rtl' the marker box be on the right side of
the content.
The marker box is fixed with respect to the principal block box's
border and does not scroll with the principal block box's content.
<!--telcon 2010-11-24-->In CSS&nbsp;2.1, a UA may hide the marker if
the element's <span class=propinst-overflow>'overflow'</span> is other
than 'visible'. (This is expected to change in the future.)<!--/telcon
2010-11-24-->
The size or contents of the marker box may affect the height of the
principal block box and/or the height of its first line box, and in
some cases may cause the creation of a new line box. <span
class=note><strong>Note:</strong> This interaction may be more
precisely defined in a future level of CSS.</span>
<dt><strong>inside</strong>
<dd>The marker box is placed as the first inline box in the principal
block box, before the element's content and before any :before
pseudo-elements. CSS&nbsp;2.1 does not specify
the precise location of the marker box.
</dl>
<div class="html-example"><P>
For example:
<PRE>
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Comparison of inside/outside position&lt;/TITLE&gt;
&lt;STYLE type="text/css"&gt;
ul { list-style: outside }
ul.compact { list-style: inside }
&lt;/STYLE&gt;
&lt;/HEAD&gt;
&lt;BODY&gt;
&lt;UL&gt;
&lt;LI&gt;first list item comes first
&lt;LI&gt;second list item comes second
&lt;/UL&gt;
&lt;UL class="compact"&gt;
&lt;LI&gt;first list item comes first
&lt;LI&gt;second list item comes second
&lt;/UL&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</PRE>
<P> The above example may be formatted as:</P>
<div class="figure">
<P><img src="./images/list-inout.png" alt="Difference between inside
and outside list style position"></p>
</div>
<P>In right-to-left text, the markers would have been on the right
side of the box.
</div>
<!-- #include src=properties/list-style.srb -->
<P> The <span class="propinst-list-style">'list-style'</span> property
is a shorthand notation for setting the three properties <span
class="propinst-list-style-type">'list-style-type'</span>, <span
class="propinst-list-style-image">'list-style-image'</span>, and <span
class="propinst-list-style-position">'list-style-position'</span> at
the same place in the style sheet.
<div class="example"><P>
<PRE>
ul { list-style: upper-roman inside } /* Any "ul" element */
ul > li > ul { list-style: circle outside } /* Any "ul" child
of an "li" child
of a "ul" element */
</PRE>
</div>
<P>Although authors may specify <span
class="propinst-list-style">'list-style'</span> information directly
on list item elements (e.g., "li" in HTML), they should do so with
care. The following rules look similar, but the first declares a <a
href="./selector.html#descendant-selectors">descendant selector</a>
and the second a (more specific) <a
href="./selector.html#child-selectors">child
selector.</a>
<PRE class="example">
ol.alpha li { list-style: lower-alpha } /* Any "li" descendant of an "ol" */
ol.alpha > li { list-style: lower-alpha } /* Any "li" child of an "ol" */
</PRE>