Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/fonts/ahem.css">
<style>
.grid {
display: grid;
width: 100px;
height: 100px;
overflow: auto;
border: 1px solid black;
margin-bottom: 10px;
grid-template-rows: 40px 40px 40px;
grid-template-columns: repeat(2, 30px);
font-family: Ahem;
}
.first { align-items: first baseline; }
.last { align-items: last baseline; }
.grid > div { width: 30px; height: 30px; line-height: normal; }
</style>
</head>
<body>
<div class="grid first" id="first">
<div style="grid-row: 1; grid-column: 1; font-size: 22px; background: slateblue;">C</div>
<div style="grid-row: 1; grid-column: 2; font-size: 14px; background: tomato;">F</div>
<div style="grid-row: 2; grid-column: 1; font-size: 20px; background: steelblue;">B</div>
<div style="grid-row: 2; grid-column: 2; font-size: 16px; background: seagreen;">E</div>
<div style="grid-row: 3; grid-column: 1; font-size: 24px; background: coral;">A</div>
<div style="grid-row: 3; grid-column: 2; font-size: 12px; background: goldenrod;">D</div>
</div>
<div class="grid last" id="last">
<div style="grid-row: 1; grid-column: 1; font-size: 22px; background: slateblue;">C</div>
<div style="grid-row: 1; grid-column: 2; font-size: 14px; background: tomato;">F</div>
<div style="grid-row: 2; grid-column: 1; font-size: 20px; background: steelblue;">B</div>
<div style="grid-row: 2; grid-column: 2; font-size: 16px; background: seagreen;">E</div>
<div style="grid-row: 3; grid-column: 1; font-size: 24px; background: coral;">A</div>
<div style="grid-row: 3; grid-column: 2; font-size: 12px; background: goldenrod;">D</div>
</div>
</body>
<script>
document.getElementById('first').scrollTop = 1000000;
document.getElementById('last').scrollTop = 1000000;
</script>
</html>