4 <meta name=
"viewport" content=
"width=800">
6 html { font-size:
16px; }
7 body { width:
800px; margin:
0; overflow-y: hidden; }
8 ul { list-style: none; padding-left:
0; }
12 <ul style=
"width: 400px;">
13 <li style=
"width: 600px; font-size: 1.25rem">
14 This element is only autosized to
20px computed font size (
16 *
400/
320), since we don't want list items to be autosized differently from each other, and the width of UL tag is used for autosizing.
<br>
15 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
17 <li style=
"font-size: 1.25rem">
18 This element is autosized to computed font size of
20px similarly to the first list item.
<br>
19 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
21 <li style=
"float: left; width: 800px; font-size: 2.5rem">
22 This list element becomes a separate autosizing cluster since it's floating. Hence its computed font size is
40px (
16 *
800 /
320).
<br>
23 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
25 <li style=
"position: absolute; overflow: auto; margin-top: 280px; width: 800px; font-size: 2.5rem">
26 This list element becomes a separate autosizing cluster since it's positioned out of the list flow. Hence its computed font size is
40px (
16 *
800 /
320).
<br>
27 Margin is added so it doesn't overlap with the previous element.
<br>
28 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.