<!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> <li> <p>Item 6 with lots of text in it that will just wrap to whatever width to show how that behaves here</p> </li> <li> <p>Item 7</p> </li> <li> <p>Item 8</p> </li> <li> <p>Item 9</p> </li> </ol> </body> </html>
body { font-family: sans-serif; padding: 20px; } ol { background-color: gold; } li { background-color: tomato; border-bottom: 2px solid firebrick; border-right: 2px solid firebrick; padding: 5px; }
ol { display: grid; grid-auto-rows: 80px; grid-template-columns: 1fr; } @media (min-width: 400px) { ol { grid-template-columns: 2fr 1fr; } } @media (min-width: 500px) { ol { grid-template-columns: 1fr 1fr 1fr; } }