ignoring everything after that. So it has to be all inside <figcaption>. See
also https://github.com/mosra/m.css/issues/117 for details. */
figure.m-figure figcaption .m-figure-description {
- display: block;
margin-top: 0.5rem;
font-weight: normal;
font-size: 1rem;
text-decoration: none;
}
figure.m-figure figcaption .m-figure-description {
- display: block;
margin-top: 0.5rem;
font-weight: normal;
font-size: 1rem;
text-decoration: none;
}
figure.m-figure figcaption .m-figure-description {
- display: block;
margin-top: 0.5rem;
font-weight: normal;
font-size: 1rem;
text-decoration: none;
}
figure.m-figure figcaption .m-figure-description {
- display: block;
margin-top: 0.5rem;
font-weight: normal;
font-size: 1rem;
text-decoration: none;
}
figure.m-figure figcaption .m-figure-description {
- display: block;
margin-top: 0.5rem;
font-weight: normal;
font-size: 1rem;
<img src="{static}/static/ship-small.jpg" />
<figcaption>
A Ship
- <span class="m-figure-description">Photo ©
- <a href="http://blog.mosra.cz/">The Author</a></span>
+ <div class="m-figure-description">
+ Photo © <a href="http://blog.mosra.cz/">The Author</a>
+ </div>
</figcaption>
</figure>
<a href="http://blog.mosra.cz/"><img src="{static}/static/ship-small.jpg" /></a>
<figcaption>
A Ship
- <span class="m-figure-description">Photo ©
- <a href="http://blog.mosra.cz/">The Author</a></span>
+ <div class="m-figure-description">
+ Photo © <a href="http://blog.mosra.cz/">The Author</a>
+ </div>
</figcaption>
</figure>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
A Somewhat Lengthy Caption For A Photo
- <span class="m-figure-description">The Photo Displayed Above Was Kindly
- Taken And Allowed To Be Used On This Page By
- <a href="http://blog.mosra.cz/">The Author</a>. All Rights
- Reserved.</span>
+ <div class="m-figure-description">
+ The Photo Displayed Above Was Kindly Taken And Allowed To Be Used On
+ This Page By <a href="http://blog.mosra.cz/">The Author</a>. All
+ Rights Reserved.
+ </div>
</figcaption>
</figure>
<img src="{static}/static/ship.jpg" />
<figcaption>
A Somewhat Lengthy Caption For A Photo
- <span class="m-figure-description">The Photo Displayed Above Was Kindly
- Taken And Allowed To Be Used On This Page By
- <a href="http://blog.mosra.cz/">The Author</a>. All Rights
- Reserved.</span>
+ <div class="m-figure-description">
+ The Photo Displayed Above Was Kindly Taken And Allowed To Be Used On
+ This Page By <a href="http://blog.mosra.cz/">The Author</a>. All
+ Rights Reserved.
+ </div>
</figcaption>
</figure>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
A Somewhat Lengthy Caption For A Photo
- <span class="m-figure-description">The Photo Displayed Above Was Kindly
- Taken And Allowed To Be Used On This Page By
- <a href="http://blog.mosra.cz/">The Author</a>. All Rights
- Reserved.</span>
+ <div class="m-figure-description">
+ The Photo Displayed Above Was Kindly Taken And Allowed To Be Used On
+ This Page By <a href="http://blog.mosra.cz/">The Author</a>. All
+ Rights Reserved.
+ </div>
</figcaption>
</figure>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Default figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Primary figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Success figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Warning figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Danger figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Info figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
<img src="{static}/static/ship-small.jpg" />
<figcaption>
Dim figure
- <span class="m-figure-description">Text.</span>
+ <div class="m-figure-description">Text.</div>
</figcaption>
</figure>
</div>
As with plain image, it's by default centered, slightly rounded and has a
border around the caption and description. The caption is expected to be in the
:html:`<figcaption>` element. Inside it, there can optionally be a longer
-description wrapped in a :css:`.m-figure-description` element. The
+description wrapped in a :css:`div.m-figure-description` element. The
:css:`.m-fullwidth` class works here too and you can also wrap the
:html:`<img>` / :html:`<svg>` element in an :html:`<a>` tag to make it
clickable.
<img src="ship.jpg" alt="Ship" />
<figcaption>
A Ship
- <span class="m-figure-description">
+ <div class="m-figure-description">
Photo © <a href="http://blog.mosra.cz/">The Author</a>
- </span>
+ </div>
</figcaption>
</figure>
<img src="{static}/static/ship-small.jpg" alt="Ship" />
<figcaption>
A Ship
- <span class="m-figure-description">
+ <div class="m-figure-description">
Photo © <a href="http://blog.mosra.cz/">The Author</a>
- </span>
+ </div>
</figcaption>
</figure>
While a description *could* be put also after a :html:`<figcaption>` such
as in the following snippet, CSS styling used by m.css causes Firefox to
display only the :html:`<figcaption>`, ignoring everything after. Thus it's
- recommended to always nest the description in a :css:`.m-figure-description`
- element inside. See also :gh:`mosra/m.css#117` for more information.
+ recommended to always nest the description in a
+ :css:`div.m-figure-description` element inside. See also
+ :gh:`mosra/m.css#117` for more information.
.. code:: html
<figure class="m-figure">
<img src="ship.jpg" alt="Ship" />
<figcaption>A Ship</figcaption>
- <span>Photo © The Author</span> <!-- This will get ignored by Firefox! -->
+ <div>Photo © The Author</div> <!-- This will get ignored by Firefox! -->
</figure>
.. note-info::
figure width being defined by the math equation size. Create a
:html:`<figure class="m-figure">` element and put :html:`<svg class="m-math">`
as a first child. The remaining content of the figure can be
-:html:`<figcaption>` with optional :css:`.m-figure-description` same as with
+:html:`<figcaption>` with optional :css:`div.m-figure-description` same as with
`image figures <#figures>`_. Add the :css:`.m-flat` class to the
:html:`<figure>` to remove the outer border and equation background,
`CSS color classes`_ on the :html:`<figure>` affect the figure, on the
</svg>
<figcaption>
Theorem
- <span class="m-figure-description">A Pythagorean one.</span>
+ <div class="m-figure-description">A Pythagorean one.</div>
</figcaption>
</figure>
</svg>
<figcaption>
Theorem
- <span class="m-figure-description">A Pythagorean one.</span>
+ <div class="m-figure-description">A Pythagorean one.</div>
</figcaption>
</figure>
</svg>
<figcaption>
Impenetrable logic
- <span class="m-figure-description">No.</span>
+ <div class="m-figure-description">No.</div>
</figcaption>
</figure>
</svg>
<figcaption>
Impenetrable logic
- <span class="m-figure-description">No.</span>
+ <div class="m-figure-description">No.</div>
</figcaption>
</figure>
def depart_figure(self, node):
# See depart_caption() below for details
if self.in_figure_caption_with_description:
- self.body.append('</span>\n</figcaption>\n')
+ self.body.append('</div>\n</figcaption>\n')
self.in_figure_caption_with_description = False
self.body.append('</figure>\n')
# such, figure out a way to query if there are useful nodes. Can't
# check for just nodes.legend, as there can be arbitrary other stuff.
if 'classes' in node.parent and 'm-figure' in node.parent['classes'] and node.next_node(descend=False, siblings=True) is not None:
- self.body.append(self.starttag(node, 'span', CLASS='m-figure-description'))
+ self.body.append(self.starttag(node, 'div', CLASS='m-figure-description'))
self.in_figure_caption_with_description = True
else:
self.body.append('</figcaption>\n')
<svg class="m-math" style="width: 5rem; height: 5rem;"></svg><p>Math figure contents.</p>
</figure>
<figure class="m-figure">
-<svg class="m-graph" style="width: 5rem; height: 5rem;"></svg><figcaption>Caption<span class="m-figure-description">
+<svg class="m-graph" style="width: 5rem; height: 5rem;"></svg><figcaption>Caption<div class="m-figure-description">
<p>Graph figure contents.</p>
-</span>
+</div>
</figcaption>
</figure>
<div class="m-text m-dim">
</g>
</g>
</svg>
-<figcaption>This is a title.<span class="m-figure-description">
+<figcaption>This is a title.<div class="m-figure-description">
<p>This is a description.</p>
-</span>
+</div>
</figcaption>
</figure>
<figure class="m-figure">
</g>
</g>
</svg>
-<figcaption>This is a title.<span class="m-figure-description">
+<figcaption>This is a title.<div class="m-figure-description">
<p>This is a description.</p>
-</span>
+</div>
</figcaption>
</figure>
<figure class="m-figure">
<p>Figure:</p>
<figure class="m-figure">
<img src="./ship.jpg" />
-<figcaption>A Ship<span class="m-figure-description">
-Yes.</span>
+<figcaption>A Ship<div class="m-figure-description">
+Yes.</div>
</figcaption>
</figure>
<p>Figure with link, scale and only a caption:</p>