Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!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="row-justify-self-004-ref.html">
<style>
.preview {
display: grid-lanes;
grid-lanes-direction: row;
grid-template-rows: repeat(3, 50px);
width: 100px;
margin-bottom: 8px;
}
.item-1 {
grid-row: 1 / span 2;
background: #fbc4c4;
}
.item-2 {
grid-row: 3;
width: 100px;
background: #bae0fd;
}
.item-3 {
grid-row: 1 / span 3;
width: 10px;
margin-left: -40px;
background: #fde8a0;
}
.end .item-1 {
width: 20px;
justify-self: end;
}
.center .item-1 {
width: 20px;
justify-self: center;
}
.stretch .item-1 {
justify-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>