Skip to content

Commit 0cf2a02

Browse files
committed
[FEATURE] Add CSS float support for image/figure alignment
Add missing float CSS properties for images and figures, fix :align: directive handling, and split rendertest into focused pages. - Add float: left/right to img.float-left/img.float-right rules - Add figure float rules with max-width: 50% and responsive breakpoint - Add img/figure align-center CSS for centered alignment - Replace deprecated HTML align attribute with CSS class mapping - Preserve :align: option on FigureNode, strip float from inner img - Add .clear-both CSS utility alias - Split ImagesAndFigures rendertest into Index, Zoom, FloatAndAlignment Resolves: #1172
1 parent d0aeafb commit 0cf2a02

10 files changed

Lines changed: 471 additions & 257 deletions

File tree

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
.. include:: /Includes.rst.txt
2+
3+
.. _images-float-and-alignment:
4+
5+
===================
6+
Float and alignment
7+
===================
8+
9+
.. contents:: This page
10+
:backlinks: top
11+
:class: compact-list
12+
:depth: 99
13+
:local:
14+
15+
16+
Image float left
17+
================
18+
19+
.. |example-teaser-left| image:: ../images/q150_cccccc.png
20+
:alt: Left floating image
21+
:class: float-left with-shadow
22+
23+
|example-teaser-left|
24+
Typesetting is the composition of text by means of arranging physical
25+
types[1] or the digital equivalents. Stored letters and other symbols
26+
(called sorts in mechanical systems and glyphs in digital systems)
27+
are retrieved and ordered according to a language's orthography for
28+
visual display.
29+
30+
.. rst-class:: clear-both
31+
32+
Floating cleared. Below the image.
33+
34+
35+
Image float right
36+
=================
37+
38+
.. |example-teaser-right| image:: ../images/q150_cccccc.png
39+
:alt: Right floating image
40+
:class: float-right with-shadow
41+
42+
|example-teaser-right|
43+
Typesetting is the composition of text by means of arranging physical
44+
types[1] or the digital equivalents. Stored letters and other symbols
45+
(called sorts in mechanical systems and glyphs in digital systems)
46+
are retrieved and ordered according to a language's orthography for
47+
visual display.
48+
49+
.. rst-class:: clear-both
50+
51+
Floating cleared. Below the image.
52+
53+
54+
Figure float left
55+
=================
56+
57+
.. figure:: ../images/q150_cccccc.png
58+
:alt: Left floating figure
59+
:class: float-left with-shadow
60+
61+
A figure floated to the left
62+
63+
Typesetting is the composition of text by means of arranging physical
64+
types[1] or the digital equivalents. Stored letters and other symbols
65+
(called sorts in mechanical systems and glyphs in digital systems)
66+
are retrieved and ordered according to a language's orthography for
67+
visual display. Typesetting requires one or more fonts. The source
68+
could be a manuscript, a previously composed version, or a plain text.
69+
70+
.. rst-class:: clear-both
71+
72+
Floating cleared. Below the figure.
73+
74+
75+
Figure float right
76+
==================
77+
78+
.. figure:: ../images/q150_cccccc.png
79+
:alt: Right floating figure
80+
:class: float-right with-shadow
81+
82+
A figure floated to the right
83+
84+
Typesetting is the composition of text by means of arranging physical
85+
types[1] or the digital equivalents. Stored letters and other symbols
86+
(called sorts in mechanical systems and glyphs in digital systems)
87+
are retrieved and ordered according to a language's orthography for
88+
visual display. Typesetting requires one or more fonts. The source
89+
could be a manuscript, a previously composed version, or a plain text.
90+
91+
.. rst-class:: clear-both
92+
93+
Floating cleared. Below the figure.
94+
95+
96+
Figure align left
97+
=================
98+
99+
.. figure:: ../images/q150_cccccc.png
100+
:alt: Left aligned figure
101+
:align: left
102+
103+
A figure aligned left via :align:
104+
105+
Typesetting is the composition of text by means of arranging physical
106+
types[1] or the digital equivalents. Stored letters and other symbols
107+
(called sorts in mechanical systems and glyphs in digital systems)
108+
are retrieved and ordered according to a language's orthography for
109+
visual display. Typesetting requires one or more fonts. The source
110+
could be a manuscript, a previously composed version, or a plain text.
111+
112+
.. rst-class:: clear-both
113+
114+
Floating cleared. Below the figure.
115+
116+
117+
Figure align right
118+
==================
119+
120+
.. figure:: ../images/q150_cccccc.png
121+
:alt: Right aligned figure
122+
:align: right
123+
124+
A figure aligned right via :align:
125+
126+
Typesetting is the composition of text by means of arranging physical
127+
types[1] or the digital equivalents. Stored letters and other symbols
128+
(called sorts in mechanical systems and glyphs in digital systems)
129+
are retrieved and ordered according to a language's orthography for
130+
visual display. Typesetting requires one or more fonts. The source
131+
could be a manuscript, a previously composed version, or a plain text.
132+
133+
.. rst-class:: clear-both
134+
135+
Floating cleared. Below the figure.

0 commit comments

Comments
 (0)