1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-page-3/#margin-dimension">
<meta name="assert" content="Test auto lengths. Max content sizes are larger than available size, but their min sizes are not. No center boxes.">
<meta name="flags" content="ahem">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<link rel="match" href="dimensions-006-print-ref.html">
<style>
:root {
print-color-adjust: exact;
}
@page {
margin: 6em;
width: 20em;
height: 15em;
font: 16px/1 Ahem;
/* Left min: 4em
Left max: 17em
Right min: 2em
Right max: 5em
Min total: 4em + 2em = 6em
Max total: 17em + 5em = 22em
Max content sizes are larger than available size. Min content sizes are
smaller. Start at min size, and distribute extra space proportionally to
the difference between max and min.
Left flex (max - min): 13
Right flex (max - min): 3
Flex total: 16
Available space: 20em
Unused space: 20em - 6em = 14em
Width of left box: 4em + 14em * 13/16 = 15.375em
Width of right box: 2em + 14em * 3/16 = 4.625em */
@top-left {
text-align: left;
vertical-align: top;
margin-bottom: 3em;
content: "xxx xx xx xx xxxx";
background: hotpink;
}
@top-right {
text-align: left;
vertical-align: top;
margin-top: 3em;
content: "xx xx";
background: yellow;
}
/* Top min: 4em
Top max: 13em
Bottom min: 2em
Bottom max: 5em
Min total: 4em + 2em = 6em
Max total: 13em + 5em = 18em
Max content sizes are larger than available size. Min content sizes are
smaller. Start at min size, and distribute extra space proportionally to
the difference between max and min.
Top flex (max - min): 9
Bottom flex (max - min): 3
Flex total: 12
Available space: 15em
Unused space: 15em - 6em = 9em
Height of top box: 4em + 9em * 9/12 = 10.75em
Height of bottom box: 2em + 9em * 3/12 = 4.25em */
@left-top {
text-align: left;
vertical-align: top;
writing-mode: vertical-rl;
content: "xxx x xx xxxx";
background: yellow;
}
@left-bottom {
text-align: left;
vertical-align: top;
writing-mode: vertical-rl;
content: "xx xx";
background: hotpink;
}
/* Top min: 6em
Top max: 30em
Bottom min: 2em
Bottom max: 34em
Min total: 6em + 2em = 8em
Max total: 30em + 34em = 64em
Max content sizes are larger than available size. Min content sizes are
smaller. Start at min size, and distribute extra space proportionally to
the difference between max and min.
Top flex (max - min): 24
Bottom flex (max - min): 32
Flex total: 56
Available space: 15em
Unused space: 15em - 8em = 7em
Height of top box: 6em + 7em * 24/56 = 9em
Height of bottom box: 2em + 7em * 32/56 = 6em */
@right-top {
text-align: left;
vertical-align: top;
writing-mode: vertical-rl;
content: "x x xxxxxx x x x x x x x x x x";
background: hotpink;
}
@right-bottom {
text-align: left;
vertical-align: top;
writing-mode: vertical-rl;
content: "x x x x x x x x x x x x x x x x xx";
background: yellow;
}
/* Left min: 6em
Left max: 34em
Right min: 2em
Right max: 38em
Min total: 6em + 2em = 8em
Max total: 34em + 38em = 72em
Max content sizes are larger than available size. Min content sizes are
smaller. Start at min size, and distribute extra space proportionally to
the difference between max and min.
Left flex (max - min): 28
Right flex (max - min): 36
Flex total: 64
Available space: 20em
Unused space: 20em - 8em = 12em
Width of left box: 6em + 12em * 28/64 = 11.25em
Width of right box: 2em + 12em * 36/64 = 8.75em */
@bottom-left {
text-align: left;
vertical-align: top;
margin-top: 1em;
content: "x x xxxxxx x x x x x x x x x x x x";
background: yellow;
}
@bottom-right {
text-align: left;
vertical-align: top;
content: "x x x x x x x x x x x x x x x x x x xx";
background: hotpink;
}
</style>
|