I’d like to use a CSS grid to place some elements. But because of the way the page is generated, some of the elements I want to place are wrapped in the same (otherwise empty) intermediate element. My attempts to place those elements is unsuccessful; only the intermediate wrapper element is placed. See the example below:
div#top {
display: grid;
grid-template-rows: repeat(2, 1fr);
grid-template-columns: repeat(2, 1fr);
grid-row-gap: 10px;
grid-column-gap: 10px;
}
div#one {
grid-row-start: 1;
grid-row-end: 2;
grid-column-start: 1;
grid-column-end: 2;
}
div#two {
grid-row-start: 1;
grid-row-end: 2;
grid-column-start: 2;
grid-column-end: 3;
}
div#three {
grid-row-start: 2;
grid-row-end: 3;
grid-column-start: 1;
grid-column-end: 2;
}
div#top, div#one, div#two, div#three {
border: 1px solid red;
border-radius: 10px;
padding: 10px;
}
<div id="top">
<div id="one">One</div>
<div id="wrapper">
<div id="two">Two</div>
<div id="three">Three</div>
</div>
</div>
Is there a way I can make the wrapper element “transparent” so that the elements it contains are placed in the grid?