@@ -275,6 +275,37 @@ Intrinsic Aspect Ratios: the 'aspect-ratio' property</h3>
275275 </pre>
276276 </div>
277277
278+ <div class="example">
279+ In the following example:
280+
281+ <pre>
282+ <div id=container style="height: 100px; float: left;">
283+ <div id=item style="height: 100%; aspect-ratio: 1/1;">content</div>
284+ </div>
285+ </pre>
286+
287+ Since the height of the <code> #item</code> is a percentage that resolves against a definite container,
288+ the width of the item resolves to 100px for both its intrinsic size contributions as well as for final layout,
289+ so the container also sizes to a width of 100px.
290+
291+ <pre>
292+ <div id=container style="height: auto; float: left;">
293+ <div id=item style="height: 100%; aspect-ratio: 1/1;">content</div>
294+ </div>
295+ </pre>
296+
297+ In this next example,
298+ the percentage height of the item cannot be resolved and [=behaves as auto=]
299+ (see [[CSS2/visudet#the-height-property]] ).
300+ Since both axes now have an [=automatic size=] ,
301+ the height becomes the [=ratio-dependent axis=] .
302+ Calculating the [=intrinsic size contributions=] of the box
303+ produces a width derived from its content,
304+ and a height calculated from that width and the aspect ratio,
305+ yielding a square box (and a container) sized
306+ to the width of the word “content”.
307+ </div>
308+
278309 On non-replaced elements with an ''width/auto'' <a>inline size</a>
279310 (or any replaced element whose intrinsic <a>block size</a>
280311 depends on its <a>inline size</a> ),
0 commit comments