-2

enter image description here

I would like to have that layout with the following HTML:

<div>
  <p>left</p>
  <p>right 1</p>
  <p>right 2</p>
  <p>right 3</p>
  <p>right 4</p>
</div>

I can't change the HTML, can you help me achieve that with CSS grid?

https://jsfiddle.net/1y98feza/

pickos75
  • 45
  • 6

1 Answers1

0

Here is how you can do it if you absolutely can't use anything else:

div{
    display: grid;
}

p
{
    border: 5px solid #FF0000;
}

p:nth-child(1)
{
    grid-area: 1 / 1 / span 4 / span 1;
}

p:nth-child(2)
{
    grid-area: sidebar;
}
Flashcap
  • 141
  • 2
  • 17