<!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 with <br>a line break</p> </li> <li> <p>Item 3 <br>also</p> </li> <li> <p>Item 4</p> </li> <li> <p>Item 5 with more text so it wraps</p> </li> </ol> <ol> <li> <p>Item 1</p> </li> <li> <p>Item 2 with <br>a line break</p> </li> <li> <p>Item 3 <br>also</p> </li> <li> <p>Item 4</p> </li> <li> <p>Item 5 with more text so it wraps</p> </li> </ol> <ol> <li> <p>Item 1</p> </li> <li> <p>Item 2 with <br>a line break</p> </li> <li> <p>Item 3 <br>also</p> </li> <li> <p>Item 4</p> </li> <li> <p>Item 5 with more text so it wraps</p> </li> </ol> <ol> <li> <p>Item 1</p> </li> <li> <p>Item 2 with <br>a line break</p> </li> <li> <p>Item 3 <br>also</p> </li> <li> <p>Item 4</p> </li> <li> <p>Item 5 with more text so it wraps</p> </li> </ol> <ol> <li> <p>Item 1</p> </li> <li> <p>Item 2 with <br>a line break</p> </li> <li> <p>Item 3 <br>also</p> </li> <li> <p>Item 4</p> </li> <li> <p>Item 5 with more text so it wraps</p> </li> </ol> </body> </html>
body { font-family: sans-serif; padding: 20px; } ol { background-color: gold; } ol:not(:first-child) { margin-top: 20px; } li { background-color: tomato; border-bottom: 2px solid firebrick; border-right: 2px solid firebrick; padding: 5px; }
ol { display: flex; flex-wrap: wrap; height: 120px; } ol:nth-child(1) { gap: 10px; } ol:nth-child(2) { row-gap: 10px; } ol:nth-child(3) { column-gap: 20px; } ol:nth-child(4) { gap: 10px 20px; } /* Shorthand. */ ol:nth-child(5) { justify-content: space-between; align-content: space-between; gap: 10px; /* No effect, here! */ }