@@ -21,6 +21,8 @@ Ignored Terms: near, 3em, intrude, top-corner, bottom-corner, left, right, both,
21
21
22
22
<h2 id="overview">Overview</h2>
23
23
24
+ <em> This section is not normative.</em>
25
+
24
26
This specification adds new keywords on the 'float' property.
25
27
26
28
This document allows to specify whether a <a>float</a> floats to align with a
@@ -65,110 +67,15 @@ Terminology</h2>
65
67
<dt> <dfn>Float containing block formatting context</dfn>
66
68
<dd>
67
69
The block formatting context inside of which the float is embedded.
70
+ <dt> <dfn>Initial float reference</dfn>
71
+ <dd>
72
+ The entity to which the float is aligned initially, before automatic float
73
+ deference takes place.
68
74
<dt> <dfn>Float reference</dfn>
69
75
<dd>
70
76
The entity to which the float is aligned.
71
77
</dl>
72
78
73
- <h2 id="positioning">
74
- Difference between inline floats and absolutely positioned elements</h2>
75
-
76
- <p>
77
- Inline floats and absolutely positioned elements are both out-of-flow elements.
78
- Absolutely positioned elements that are also exclusions can imitate many of
79
- the features of floats.
80
-
81
- <p>
82
- However, in the case of inline floats, the block formatting context that
83
- contains them (the <a>float containing block formatting context</a> ) is
84
- required to include the area occupied by the float, which is not a requirement
85
- for absolutely positioned elements.
86
-
87
- <div class="example">
88
- An inline float inside a <a>float containing block formatting context</a> given
89
- by a display-inline-block element. The element, which has a green border, is
90
- expanded to include the brown float.
91
-
92
- <code><pre>
93
- <style>
94
- .float {
95
- float: left;
96
- margin: 5px;
97
- }
98
- .border {
99
- border: 3px solid black;
100
- margin: 5px;
101
- }
102
- #outer {
103
- border: 1px solid green;
104
- display: inline-block;
105
- }
106
- canvas {
107
- background-color: brown;
108
- }
109
- p {
110
- margin: 5px;
111
- }
112
- </style>
113
- <div id="outer">
114
- <p class="border">
115
- <span class="float border">
116
- <canvas width="100" height="100"/>
117
- </span>
118
- First paragraph.
119
- </p>
120
- <p class="border">
121
- Second paragraph and some more text.
122
- </p>
123
- </div>
124
- </pre></code>
125
-
126
- <img alt="sample rendering" src="images/float_containing_context.png">
127
-
128
- In comparison, the below is the same HTML, but the float is replaced by an
129
- absolutely positioned element that is also an exclusion. The <a>float
130
- containing block formatting context</a> is still given by a
131
- display-inline-block element. However, the element, marked by a green border,
132
- does not expand to include the brown, absolutely positioned element.
133
-
134
- <code><pre>
135
- <style>
136
- .float {
137
- position: absolute;
138
- top: 8px;
139
- left: 8px;
140
- wrap-flow: both;
141
- }
142
- .border {
143
- border: 3px solid black;
144
- margin: 5px;
145
- }
146
- #outer {
147
- border: 1px solid green;
148
- display: inline-block;
149
- position: relative;
150
- }
151
- canvas {
152
- background-color: brown;
153
- }
154
- </style>
155
- <div id="outer">
156
- <p class="border">
157
- <span class="float border">
158
- <canvas width="100" height="100"/>
159
- </span>
160
- First paragraph.
161
- </p>
162
- <p class="border">
163
- Second paragraph and some more text.
164
- </p>
165
- </div>
166
- </pre></code>
167
-
168
- <img alt="sample rendering" src="images/positioned_containing_context.png">
169
-
170
- </div>
171
-
172
79
173
80
<h2 id="floating">
174
81
Floating to the inline-start/inline-end and block-start/block-end</h2>
@@ -921,7 +828,139 @@ img {
921
828
922
829
</div>
923
830
831
+ <h2 id="relation_to_absolutely_positioned_exclusions">
832
+ Floats and absolutely positioned exclusions</h2>
833
+
834
+ Floats and absolutely positioned exclusions share some common traits, but in the
835
+ case of inline floats they are not the same. Floats that are not inline floats
836
+ should behave the same as absolutely positioned exclusions with positions and
837
+ sizes manually set to prevent overlap between floats and to prevent floats from
838
+ moving beyond the edges of the float reference, with the float reference being
839
+ grown as much as needed up to its maximum extend to accommodate all containing
840
+ floats.
841
+
842
+ <h3 id="inline_floats_and_absolutely_positioned_exclusions">
843
+ Differences between inline floats and absolutely positioned elements</h3>
844
+
845
+ <em> This section is not normative.</em>
846
+
847
+ <p>
848
+ Inline floats and absolutely positioned elements are both out-of-flow elements.
849
+ Absolutely positioned elements that are also exclusions can imitate many of
850
+ the features of floats.
851
+
852
+ <p>
853
+ However, in the case of inline floats, the block formatting context that
854
+ contains them (the <a>float containing block formatting context</a> ) is
855
+ required to include the area occupied by the float, which is not a requirement
856
+ for absolutely positioned elements.
857
+
858
+ <div class="example">
859
+ An inline float inside a <a>float containing block formatting context</a> given
860
+ by a display-inline-block element. The element, which has a green border, is
861
+ expanded to include the brown float.
862
+
863
+ <code><pre>
864
+ <style>
865
+ .float {
866
+ float: left;
867
+ margin: 5px;
868
+ }
869
+ .border {
870
+ border: 3px solid black;
871
+ margin: 5px;
872
+ }
873
+ #outer {
874
+ border: 1px solid green;
875
+ display: inline-block;
876
+ }
877
+ canvas {
878
+ background-color: brown;
879
+ }
880
+ p {
881
+ margin: 5px;
882
+ }
883
+ </style>
884
+ <div id="outer">
885
+ <p class="border">
886
+ <span class="float border">
887
+ <canvas width="100" height="100"/>
888
+ </span>
889
+ First paragraph.
890
+ </p>
891
+ <p class="border">
892
+ Second paragraph and some more text.
893
+ </p>
894
+ </div>
895
+ </pre></code>
896
+
897
+ <img alt="sample rendering" src="images/float_containing_context.png">
898
+
899
+ In comparison, the below is the same HTML, but the float is replaced by an
900
+ absolutely positioned element that is also an exclusion. The <a>float
901
+ containing block formatting context</a> is still given by a
902
+ display-inline-block element. However, the element, marked by a green border,
903
+ does not expand to include the brown, absolutely positioned element.
904
+
905
+ <code><pre>
906
+ <style>
907
+ .float {
908
+ position: absolute;
909
+ top: 8px;
910
+ left: 8px;
911
+ wrap-flow: both;
912
+ }
913
+ .border {
914
+ border: 3px solid black;
915
+ margin: 5px;
916
+ }
917
+ #outer {
918
+ border: 1px solid green;
919
+ display: inline-block;
920
+ position: relative;
921
+ }
922
+ canvas {
923
+ background-color: brown;
924
+ }
925
+ </style>
926
+ <div id="outer">
927
+ <p class="border">
928
+ <span class="float border">
929
+ <canvas width="100" height="100"/>
930
+ </span>
931
+ First paragraph.
932
+ </p>
933
+ <p class="border">
934
+ Second paragraph and some more text.
935
+ </p>
936
+ </div>
937
+ </pre></code>
938
+
939
+ <img alt="sample rendering" src="images/positioned_containing_context.png">
940
+
941
+ </div>
924
942
943
+ <h3 id="fixed_height_float_references">
944
+ Page floats with float references with fixed heights
945
+ </h3>
946
+
947
+ If a page floats are inside a float reference with a fixed height, the float
948
+ reference is filled up until it cannot contain the following page float. All
949
+ subsequent page floats are deferred to the next column/region/page.
950
+
951
+ <h3 id="variable_height_nomaximum_float_references">
952
+ Page floats with variable height float references with no maximum height
953
+ </h3>
954
+ Variable height float references are grown to accommodate all its containing page
955
+ floats. Page floats inside of variable height float references without a maximum
956
+ height are therefore never deferred automatically.
957
+
958
+ <h3 id="variable_heihgt_maximum_height_float_references">
959
+ Page floats with variable height float references with a set maximum height
960
+ </h3>
961
+ Float references with a variable height with a set max height are grown to
962
+ accommodate all of its containing page floats up to their maximum height. Subsequent
963
+ page floats are deferred to the following column/region/page.
925
964
926
965
927
966
<h2 id="overconstrained-page-floats">Overconstrained floats</h2>
0 commit comments