I have a layout with a centered content column where I want an image to break out on the right side to the edge of the browser. Without an image it works fine, but with an image and a breakpoint with fixed values for the cols 2 and 3, the image takes too much space.
.copy{
grid-row-start: 1;
grid-column-start: 2;
grid-column-end: 3;
}
.img{
grid-row-start: 1;
grid-column-start: 3;
grid-column-end: 5;
width: 100%;
}
.grid-container-centered {
wodth: 100%;
display: grid;
grid-template-columns: 5% 45% 45% 5%;
}
// now it starts breaking with an image
@media (min-width: 1280px) {
.grid-container-centered {
grid-template-columns: auto 576px 576px auto; // 576px => 1280*0.9 / 2
}
}
I have created a demo there https://codepen.io/destroy90210/pen/OJbJQby?editors=1100
Solution Instead of "auto" it must be "1fr"
grid-template-columns: 1fr 576px 576px 1fr;