Home › Forums › CSS › Why css-grid doesn't work correctly in dynamically changing lauout using Jquery? › Reply To: Why css-grid doesn't work correctly in dynamically changing lauout using Jquery?
March 13, 2018 at 12:53 pm
#268230
Member
You’d defined certain children as having grid positions but those weren’t being updated by the JQuery.
The same goes for some of the divs…which apply in multiple cases.
.main div:nth-child(3) {
background: blue;
height:100%;
}
for instance.
So if you make the selector more specific
.main > div:nth-child(2) {
background: green;
display: grid;
grid-gap: 0.4rem;
}