<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/assets/reset.css" rel="stylesheet">
<link href="setup.css" rel="stylesheet">
<link href="style.css" rel="stylesheet">
</head>
<body>
<ol>
<li>
<p>Item 1</p>
</li>
<li>
<p>Item 2 <br>with line <br>breaks</p>
</li>
<li>
<p>Item 3 <br>also</p>
</li>
<li>
<p>Item 4</p>
</li>
<li>
<p>Item 5</p>
</li>
</ol>
</body>
</html>
index.html
body {
font-family: sans-serif;
padding: 1rem;
}
ol { background-color: gold; }
ol:not(:first-child) { margin-block-start: 1rem; }
li {
background-color: tomato;
border-block-end: 0.1rem solid firebrick;
border-inline-end: 0.1rem solid firebrick;
padding: 0.5rem;
}
setup.css
ol {
align-content: center; /* Vertically. */
block-size: 85vh; /* So the alignment has an effect. */
display: grid;
gap: 1rem;
grid-template-columns: 8rem 4rem; /* Force a wrap. */
justify-content: space-evenly; /* Horizontally. */
}
style.css