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
|
<!DOCTYPE html>
<title>CSS Box Alignment: align-content block fragmentation: simple content</title>
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="help" href="https://www.w3.org/TR/css-align-3/#align-block">
<meta name="flags" content="may">
<!-- fragmented alignment is underdefined; these are two possibilities -->
<link rel="match" href="align-content-block-break-content-010-aligned-ref.html">
<link rel="match" href="align-content-block-break-content-010-unaligned-ref.html">
<style title="Needed for automation; delete to review/debug">
@import "/fonts/ahem.css";
html { font: 10px/1 Ahem; max-width: 780px; }
</style>
<style>
.pager {
column-fill: auto;
column-width: 15em;
height: 5em;
}
.test {
height: 19em;
/* show bounds of test box without interfering with margin-collapsing */
border-inline: solid black 1em;
}
.large, .float {
height: 2.5em;
break-inside: avoid;
padding: 2px; /* using padding because of margin handling bugs
margin: 2px;
switch back once fixed */
background: orange;
}
.float {
float: right;
}
.nobr {
break-inside: avoid;
}
/* readability */
.pager { border: solid 2px gray; margin: 0.5em 0; }
.test { color: #8888; text-align: center; }
.label { color: black; font-weight: bold; }
</style>
<!--
This test creates breaks:
* after some directly-contained text
* after a fixed-height block
* through some nested text
* after a block containing text
-->
<div class="pager">
<div class="test" style="align-content: center">
<span class="label">CENTER</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
<div class="pager">
<div class="test" style="align-content: end">
<span class="label">END</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
<div class="pager">
<div class="test" style="align-content: baseline">
<span class="label">BASELINE</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
<div class="pager">
<div class="test" style="align-content: last baseline">
<span class="label">LAST BASELINE</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
<div class="pager">
<div class="test" style="align-content: unsafe center">
<span class="label">UNSAFE CENTER</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
<div class="pager">
<div class="test" style="align-content: unsafe end">
<span class="label">UNSAFE END</span><br>LINE 2<br>LINE 3
<div class="large"></div>
<div class="large"></div>
<div>
LINE 4
<div class="nobr">LINE 5<br>LINE 6</div>
</div>
</div>
</div>
</div>
|