grid-self-baseline-horiz-007.html (2522B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: baseline context and self alignment (horizontal)</title> 4 <link rel="author" title="Javier Fernandez" href="mailto:jfernandez@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-grid/#alignment"> 6 <link rel="help" href="https://drafts.csswg.org/css-align-3/#baseline-align-self"> 7 <link rel="help" href="https://drafts.csswg.org/css-align-3/#align-by-baseline"> 8 <link rel="help" href="https://drafts.csswg.org/css-align-3/#align-items-property"> 9 <link rel="help" href="https://drafts.csswg.org/css-align-3/#align-self-property"> 10 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=412410"> 11 <link rel="match" href="grid-self-baseline-horiz-007-ref.html"> 12 <link rel="stylesheet" href="/fonts/ahem.css"> 13 <link rel="stylesheet" href="/css/support/alignment.css"> 14 <link rel="stylesheet" href="/css/support/grid.css"> 15 <meta name="assert" content="Test that no item shares any row-like Baseline Context and all items share 'first-column' Baseline Context. We have 2 baseline-sharing groups. Items participate in both, column and row baseline, but since they only share a column-like Baseline Context only 'justify-self' (row baseline-axis) should apply. The Baseline Alignment may increase size contribution of some items." /> 16 17 <style> 18 body { margin: 0; } 19 .block { 20 background: grey; 21 float: left; 22 margin: 5px; 23 text-orientation: sideways; 24 width: 200px; 25 height: 300px; 26 font-family: Ahem; 27 line-height: 1; 28 } 29 .block > :nth-child(1) { font-size:24px; } 30 .block > :nth-child(2) { font-size:32px; } 31 .block > :nth-child(3) { font-size:48px; } 32 .block > :nth-child(4) { font-size:64px; } 33 .item { 34 border-width: 2px 5px 3px 4px; 35 border-style: solid; 36 padding: 6px 3px 7px 8px; 37 margin: 10px 6px 4px 12px; 38 } 39 .extraLeftPadding { padding-left: 30px; } 40 .extraRightPadding { padding-right: 30px; } 41 .column { grid-auto-flow: row } 42 </style> 43 44 <p>4x1 with orthogonal items, but opposite block-flow direction.</p> 45 <div class="block grid column contentStart itemsBaseline"> 46 <div class="item verticalLR">É</div> 47 <div class="item verticalLR">É</div> 48 <div class="item verticalRL">É</div> 49 <div class="item verticalRL">É</div> 50 </div> 51 <div class="block grid column contentStart itemsBaseline"> 52 <div class="item verticalLR extraRightPadding">É</div> 53 <div class="item verticalLR extraLeftPadding">É</div> 54 <div class="item verticalRL">É</div> 55 <div class="item verticalRL">É</div> 56 </div>