Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-grid/grid-lanes/alignment/column-align-self-004.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Grid Lanes: margins should not affect alignment space</title>
<link rel="author" title="Celeste Pan" href="mailto:celestepan@microsoft.com">
<link rel="match" href="column-align-self-004-ref.html">
<style>
.preview {
display: grid-lanes;
grid-template-columns: repeat(3, 50px);
width: 150px;
height: 100px;
margin-bottom: 8px;
}
.item-1 {
grid-column: 1 / span 2;
background: #fbc4c4;
}
.item-2 {
grid-column: 3;
height: 100px;
background: #bae0fd;
}
.item-3 {
grid-column: 1 / span 3;
height: 10px;
margin-top: -40px;
background: #fde8a0;
}
.end .item-1 {
height: 20px;
align-self: end;
}
.center .item-1 {
height: 20px;
align-self: center;
}
.stretch .item-1 {
align-self: stretch;
}
</style>
</head>
<body>
<div class="preview end">
<div class="item-1">1</div>
<div class="item-2">2</div>
<div class="item-3">3</div>
</div>
<div class="preview center">
<div class="item-1">1</div>
<div class="item-2">2</div>
<div class="item-3">3</div>
</div>
<div class="preview stretch">
<div class="item-1">1</div>
<div class="item-2">2</div>
<div class="item-3">3</div>
</div>
</body>
</html>