Skip to content

Commit 0b37b53

Browse files
authored
Add some examples for <figcaption>
In particular, demonstrate it can be used to include more information about the source. Also address various nits in the preceding figure element section. Fixes #2450.
1 parent 5ef6cc1 commit 0b37b53

File tree

1 file changed

+23
-27
lines changed

1 file changed

+23
-27
lines changed

source

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18971,8 +18971,6 @@ first matching case):&lt;/p&gt;
1897118971
<dd>Uses <code>HTMLElement</code>.</dd>
1897218972
</dl>
1897318973

18974-
<!-- v2: Add a <credit> element for photo credits -->
18975-
1897618974
<p>The <code>figure</code> element <span>represents</span> some <span>flow content</span>,
1897718975
optionally with a caption, that is self-contained (like a complete sentence) and is typically
1897818976
<span>referenced</span> as a single unit from the main flow of the document.</p>
@@ -18982,25 +18980,24 @@ first matching case):&lt;/p&gt;
1898218980
be inappropriate for <code>figure</code>, but an entire sentence made of images would be
1898318981
fitting.</p>
1898418982

18985-
<p>The element can thus be used to annotate illustrations, diagrams, photos, code listings, etc.</p>
18983+
<p>The element can thus be used to annotate illustrations, diagrams, photos, code listings,
18984+
etc.</p>
1898618985

1898718986
<div class="note" id="figure-note-about-references">
18988-
1898918987
<p>When a <code>figure</code> is referred to from the main content of the document by identifying
18990-
it by its caption (e.g. by figure number), it enables such content to be easily moved away from
18991-
that primary content, e.g. to the side of the page, to dedicated pages, or to an appendix, without
18992-
affecting the flow of the document.</p>
18988+
it by its caption (e.g., by figure number), it enables such content to be easily moved away from
18989+
that primary content, e.g., to the side of the page, to dedicated pages, or to an appendix,
18990+
without affecting the flow of the document.</p>
1899318991

18994-
<p>If a <code>figure</code> element is <span>referenced</span> by its relative position, e.g. "in
18995-
the photograph above" or "as the next figure shows", then moving the figure would disrupt the
18992+
<p>If a <code>figure</code> element is <span>referenced</span> by its relative position, e.g.,
18993+
"in the photograph above" or "as the next figure shows", then moving the figure would disrupt the
1899618994
page's meaning. Authors are encouraged to consider using labels to refer to figures, rather than
1899718995
using such relative references, so that the page can easily be restyled without affecting the
1899818996
page's meaning.</p>
18999-
1900018997
</div>
1900118998

19002-
<p>The <span w-nodev>first</span> <code>figcaption</code> element child of the element, if
19003-
any, represents the caption of the <code>figure</code> element's contents. If there is no child
18999+
<p>The <span w-nodev>first</span> <code>figcaption</code> element child of the element, if any,
19000+
represents the caption of the <code>figure</code> element's contents. If there is no child
1900419001
<code>figcaption</code> element, then there is no caption.</p>
1900519002

1900619003
<p>A <code>figure</code> element's contents are part of the surrounding flow. If the purpose of
@@ -19014,7 +19011,6 @@ first matching case):&lt;/p&gt;
1901419011
the purposes of enticing readers or highlighting key topics.</p>
1901519012

1901619013
<div class="example">
19017-
1901819014
<p>This example shows the <code>figure</code> element to mark up a code listing.</p>
1901919015

1902019016
<pre>&lt;p>In &lt;a href="#l4">listing 4&lt;/a> we see the primary core interface
@@ -19028,11 +19024,9 @@ API declaration.&lt;/p>
1902819024
}&lt;/code>&lt;/pre>
1902919025
&lt;/figure>
1903019026
&lt;p>The API is designed to use UTF-8.&lt;/p></pre>
19031-
1903219027
</div>
1903319028

1903419029
<div class="example">
19035-
1903619030
<p>Here we see a <code>figure</code> element to mark up a photo that is the main content of the
1903719031
page (as in a gallery).</p>
1903819032

@@ -19046,11 +19040,9 @@ API declaration.&lt;/p>
1904619040
&lt;figcaption>Bubbles at work&lt;/figcaption>
1904719041
&lt;/figure>
1904819042
&lt;nav>&lt;a href="19414.html">Prev&lt;/a> &mdash; &lt;a href="19416.html">Next&lt;/a>&lt;/nav></pre>
19049-
1905019043
</div>
1905119044

1905219045
<div class="example">
19053-
1905419046
<p>In this example, we see an image that is <em>not</em> a figure, as well as an image and a
1905519047
video that are. The first image is literally part of the example's second sentence, so it's not a
1905619048
self-contained unit, and thus <code>figure</code> would be inappropriate.</p>
@@ -19080,11 +19072,9 @@ included with Exhibit B.
1908019072
&lt;/figure>
1908119073

1908219074
&lt;p>The case was resolved out of court.</pre>
19083-
1908419075
</div>
1908519076

1908619077
<div class="example">
19087-
1908819078
<p>Here, a part of a poem is marked up using <code>figure</code>.</p>
1908919079

1909019080
<pre>&lt;figure>
@@ -19094,11 +19084,9 @@ included with Exhibit B.
1909419084
And the mome raths outgrabe.&lt;/p>
1909519085
&lt;figcaption>&lt;cite>Jabberwocky&lt;/cite> (first verse). Lewis Carroll, 1832-98&lt;/figcaption>
1909619086
&lt;/figure></pre>
19097-
1909819087
</div>
1909919088

1910019089
<div class="example">
19101-
1910219090
<p>In this example, which could be part of a much larger work discussing a castle, nested
1910319091
<code>figure</code> elements are used to provide both a group caption and individual captions for
1910419092
each figure in the group:</p>
@@ -19118,11 +19106,9 @@ included with Exhibit B.
1911819106
&lt;img src="castle1999.jpeg" alt="The castle lies in ruins, the original tower all that remains in one piece.">
1911919107
&lt;/figure>
1912019108
&lt;/figure></pre>
19121-
1912219109
</div>
1912319110

1912419111
<div class="example">
19125-
1912619112
<p>The previous example could also be more succinctly written as follows (using <code
1912719113
data-x="attr-title">title</code> attributes in place of the nested
1912819114
<code>figure</code>/<code>figcaption</code> pairs):</p>
@@ -19136,11 +19122,9 @@ included with Exhibit B.
1913619122
alt="The castle lies in ruins, the original tower all that remains in one piece.">
1913719123
&lt;figcaption>The castle through the ages: 1423, 1858, and 1999 respectively.&lt;/figcaption>
1913819124
&lt;/figure></pre>
19139-
1914019125
</div>
1914119126

1914219127
<div class="example">
19143-
1914419128
<p>The figure is sometimes <span>referenced</span> only implicitly from the content:</p>
1914519129

1914619130
<!-- from http://www.reuters.com/article/us-usa-fiscal-idUSBRE98N11220131017 -->
@@ -19156,7 +19140,6 @@ included with Exhibit B.
1915619140
Thursday deadline drawing near.&lt;/p>
1915719141
...
1915819142
&lt;/article></pre>
19159-
1916019143
</div>
1916119144

1916219145

@@ -19179,6 +19162,19 @@ included with Exhibit B.
1917919162
the contents of the <code>figcaption</code> element's parent <code>figure</code> element<span
1918019163
w-nodev>, if any</span>.</p>
1918119164

19165+
<div class="example">
19166+
<p>The element can contain additional information about the source:</p>
19167+
19168+
<pre>&lt;figcaption>
19169+
&lt;p>A duck.&lt;/p>
19170+
&lt;p>&lt;small>Photograph courtesy of 🌟 News.&lt;/small>&lt;/p>
19171+
&lt;/figcaption></pre>
19172+
19173+
<pre>&lt;figcaption>
19174+
&lt;p>Average rent for 3-room apartments, excluding non-profit apartments&lt;/p>
19175+
&lt;p>Zürich’s Statistics Office — &lt;time datetime=2017-11-14>14 November 2017&lt;/time>&lt;/p>
19176+
&lt;/figcaption></pre>
19177+
</div>
1918219178

1918319179

1918419180
<h4>The <dfn><code>main</code></dfn> element</h4>
@@ -120939,7 +120935,7 @@ INSERT INTERFACES HERE
120939120935
Evgeny Kapun,
120940120936
Ezequiel Garz&oacute;n,
120941120937
fantasai,
120942-
Felix Sanz,
120938+
Félix Sanz,
120943120939
Felix Sasaki,
120944120940
Fernando Altomare Serboncini,
120945120941
Forbes Lindesay,

0 commit comments

Comments
 (0)