body, html {
height: 100vh;
width: 100%;
margin: 0;
padding: 0;
}
.container {
height: 100%;
width: 100%;
display: grid;
grid-template-columns: auto repeat(11, 1fr);
grid-template-rows: auto 1fr auto;
grid-template-areas:
"t t t t t t t t t t t t"
"l c c c c c c c c c c c"
"f f f f f f f f f f f f";
}
.top-menu {
grid-area: t;
background-color: red;
}
.left-menu {
grid-area: l;
background-color: blue;
}
.content {
grid-area: c;
background-color: green;
display: grid;
grid-template-columns: 33.3% 33.3% 33.3%;
grid-auto-rows: 1fr;
}
.content .item {
background-color: black;
margin: 25px;
}
.footer {
grid-area: f;
background-color: grey;
}tion: absolute;
background-color: #fff;
padding-left: 8px;
pa
dding-right: 8px;
}
<div class="container">
<div class="top-menu">
abc
</div>
<div class="left-menu">
abc
</div>
<div class="content">
<div class="item">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="footer">
abc
</div>
</div>
In the example above. I want the scroll bar to appear only on the .content div not the entire screen as it is right now. Is there a simple fix to the code above to achieve just that? I think it has something to do with removing auto-row 1fr on .content div, but then im unsure how to maintain the 3x3 item boxes.