I have a grid, which I'm using to have 2 elements overlap each-other (setting both to 1/1 grid location).
The grid div is set to max-width: 100%
, and is working correctly. However, both items in the grid are not scaling down when the browser window scales down.
.container {
display: grid;
max-width: 100%;
}
.grid_item_1 {
color: white;
width: 1600px;
height: auto;
grid-area: 1 / 1;
max-width: 100%;
min-width: 0px;
}
.grid_item_2 {
grid-area: 1/1;
max-width: 100%;
}
<div class="container">
<div class="grid_item_1">
Foo
</div>
<img width="1600" class="grid_item_2" src="https://via.placeholder.com/1600">
</div>
tl;dr; the inner image (and additional div overlapping it) don't seem to be respecting max-width: 100%
(they are using the width
value of 1600
). What am I missing? Thanks!