section { display: grid; grid-template-columns: 2fr 1fr; } div:first-child { background-color: crimson; grid-column: 1 / span 2; } div:nth-child(2) { background-color: hotpink; } div:nth-child(3) { background-color: lightsalmon; grid-column: 2; grid-row: 2 / 4; /* Instead of span. */ }
body { font-family: sans-serif; padding: 20px; } section { background-color: gold; } div { background-color: tomato; border-bottom: 2px solid firebrick; border-right: 2px solid firebrick; padding: 5px; }
<!doctype html> <html> <head> <meta charset="utf-8"> <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> <section> <div> <p>Item 1 will span across the top</p> </div> <div> <p>Item 2 with a lot of text in it that takes up some space, again I am writing this manually for some reason, but we’re already here so I may as well just keep writing nonsense to increase the height and show the layout better</p> </div> <div> <p>Item 3 continues down the side</p> </div> <div> <p>Item 4 might also have enough text to wrap and add height</p> </div> </section> </body> </html>