I am working on a webpage with the following HTML structure:
.main {
display: grid;
grid-template-columns: 1fr 2fr;
}
.main>div {
height: 200px;
}
.main>div:first-child {
border: solid 3px red;
}
.main>div:last-child {
border: solid 3px blue;
}
<div class="main">
<div>
contents 1
</div>
<div>
contents 2
</div>
</div>
https://i.sstatic.net/MpATU.png
I am pleased with the current layout where the blue div is twice the width of the red div. However, I am facing an issue when the screen size is reduced to less than 246px
, causing the blue div to hide under the browser edge :
https://i.sstatic.net/VSAAz.png
How can I ensure that the ratio between the two divs remains consistent even on smaller screen sizes?
Update: I have removed the font-size property but the problem persists.