I am using css grid in my project.I have 4 rows,4 columns and grid-gap 10px. For first and second row will take 100% width. But sometimes i need to hide second row based on server response.If i do like display none for second row there is gap 20px between 1st row and 3rd row. I want to hide row with gap in css grid otherwise it looks odd there.
code:
if i add hideRow display,height properties grid gap between first and third row 20px. I wanted to make it 10px.
.content > * {
background: green;
padding: 10px;
}
.Header{
grid-area: Header;
}
.hideRow{
/*display: none;*/
/*height: 0;*/
grid-area: hideRow;
}
.first{
grid-area: first;
}
.second{
grid-area: second;
}
.third{
grid-area: third;
}
.fourth{
grid-area: fourth;
}
.fifth{
grid-area: fifth;
}
<div style={{padding:'5%'}}>
<div className={"content"}>
<div className={"Header"}>
Header
</div>
<div className={"hideRow"}>
hiderow
</div>
<div className={"first"}>
first
</div>
<div className={"second"}>
second
</div>
<div className={"third"}>
third
</div>
<div className={"fourth"}>
fourth
</div>
<div className={"fifth"}>
fifth
</div>
</div>
</div>