Skip to content

Commit 7ed64d3

Browse files
committed
Added an example for position:marker.
1 parent cbe9679 commit 7ed64d3

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

css3-lists/Overview.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,51 @@ <h3 id=position-marker><span class=secno>7.1. </span> The &lsquo;<code
12371237
the top, right, bottom, and left edges (respectively) of the element
12381238
itself, similar to how relative positioning works.
12391239

1240+
<div class=example>
1241+
<p>&lsquo;<code class=css>position:marker</code>&rsquo; can be used when
1242+
the precise list marker is important for the content, not a stylistic
1243+
choice, but the normal <em>appearance</em> of lists is still desired. For
1244+
example, this trimmed snippet of the US Code of Laws may be marked up as
1245+
the following in HTML:</p>
1246+
1247+
<pre>
1248+
&lt;style>
1249+
ol { list-style: none; }
1250+
.marker { position: marker; }
1251+
&lt;/style>
1252+
&lt;ol>
1253+
&lt;li>
1254+
&lt;span class='marker'>(a)&lt;/span> Definitions.— For purposes of this section—
1255+
&lt;ol>
1256+
&lt;li>&lt;span class='marker'>(1)&lt;/span> the term “agency” means agency as...&lt;/li>
1257+
&lt;li>&lt;span class='marker'>(2)&lt;/span> the term “individual” means a citizen...&lt;/li>
1258+
&lt;/ol>
1259+
&lt;/li>
1260+
&lt;li>
1261+
&lt;span class='marker'>(b)&lt;/span> Conditions of Disclosure.— No agency shall disclose...
1262+
&lt;ol>
1263+
&lt;li>&lt;span class='marker'>(1)&lt;/span> to those officers and employees of the agency which...&lt;/li>
1264+
&lt;li>&lt;span class='marker'>(2)&lt;/span> required under section 552 of this title;&lt;/li>
1265+
&lt;/ol>
1266+
&lt;/li>
1267+
&lt;/ol></pre>
1268+
1269+
<p>The preceding document should render something like this:</p>
1270+
1271+
<pre>
1272+
(a) Definitions.— For purposes of this section—
1273+
(1) the term “agency” means agency as...
1274+
(2) the term “individual” means a citizen...
1275+
(b) Conditions of Disclosure.— No agency shall disclose...
1276+
(1) to those officers and employees of the agency which...
1277+
(2) required under section 552 of this title;</pre>
1278+
1279+
<p>Importantly, it will <strong>always</strong> be presented something
1280+
like that, with those exact list markers, even if the stylesheet is
1281+
unavailable, so other documents can refer to those list markers and be
1282+
confident that the reference will always be resolvable.</p>
1283+
</div>
1284+
12401285
<h3 id=marker-attachment><span class=secno>7.2. </span> The &lsquo;<a
12411286
href="#marker-attachment0"><code
12421287
class=property>marker-attachment</code></a>&rsquo; property</h3>

css3-lists/Overview.src.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,44 @@ <h3 id='position-marker'>
703703

704704
<p>The 'top', 'right', 'bottom', and 'left' properties specify offsets relative to the top, right, bottom, and left edges (respectively) of the element itself, similar to how relative positioning works.</p>
705705

706+
<div class='example'>
707+
<p>''position:marker'' can be used when the precise list marker is important for the content, not a stylistic choice, but the normal <em>appearance</em> of lists is still desired. For example, this trimmed snippet of the US Code of Laws may be marked up as the following in HTML:</p>
708+
709+
<pre>
710+
&lt;style>
711+
ol { list-style: none; }
712+
.marker { position: marker; }
713+
&lt;/style>
714+
&lt;ol>
715+
&lt;li>
716+
&lt;span class='marker'>(a)&lt;/span> Definitions.— For purposes of this section—
717+
&lt;ol>
718+
&lt;li>&lt;span class='marker'>(1)&lt;/span> the term “agency” means agency as...&lt;/li>
719+
&lt;li>&lt;span class='marker'>(2)&lt;/span> the term “individual” means a citizen...&lt;/li>
720+
&lt;/ol>
721+
&lt;/li>
722+
&lt;li>
723+
&lt;span class='marker'>(b)&lt;/span> Conditions of Disclosure.— No agency shall disclose...
724+
&lt;ol>
725+
&lt;li>&lt;span class='marker'>(1)&lt;/span> to those officers and employees of the agency which...&lt;/li>
726+
&lt;li>&lt;span class='marker'>(2)&lt;/span> required under section 552 of this title;&lt;/li>
727+
&lt;/ol>
728+
&lt;/li>
729+
&lt;/ol></pre>
730+
731+
<p>The preceding document should render something like this:</p>
732+
733+
<pre>
734+
(a) Definitions.— For purposes of this section—
735+
(1) the term “agency” means agency as...
736+
(2) the term “individual” means a citizen...
737+
(b) Conditions of Disclosure.— No agency shall disclose...
738+
(1) to those officers and employees of the agency which...
739+
(2) required under section 552 of this title;</pre>
740+
741+
<p>Importantly, it will <strong>always</strong> be presented something like that, with those exact list markers, even if the stylesheet is unavailable, so other documents can refer to those list markers and be confident that the reference will always be resolvable.</p>
742+
</div>
743+
706744
<h3 id='marker-attachment'>
707745
The 'marker-attachment' property</h3>
708746

0 commit comments

Comments
 (0)