Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<head>
<style>
html, body {
font: 16px/1 monospace;
background: white;
}
.grid {
display: grid;
grid-template-columns: 80px;
gap: 4px;
width: 200px;
height: 180px;
border: 1px solid;
align-content: end;
}
item {
display: block;
width: min-content;
height: 28px;
color: white;
background: #555;
}
</style>
</head>
<body>
<!-- Container alignment (baseline falls back to start) -->
<p>justify-content: baseline</p>
<div class="grid" style="justify-content: start;">
<item>end</item>
<item>center</item>
<item>start</item>
</div>
<!-- Self alignment -->
<p>justify-self</p>
<div class="grid">
<item style="justify-self: start;">baseline</item>
<item style="justify-self: center;">center</item>
<item style="justify-self: end;">end</item>
<item style="justify-self: start;">start</item>
</div>
</body>
</html>