Вот простой макет сетки - поскольку вы используете макет, заполняющий область просмотра, я думаю, вы можете угробить фиксированное и закрепленное позиционирование и вложенных сеток , удалите внутреннюю сетку контейнеры (grida
и gridb
) и обертывают в контейнер-сетку :
display: grid;
grid-template-columns: 1fr 1fr; /* two columns */
grid-template-rows: auto auto 1fr; /* three rows */
grid-auto-flow: column; /* place grid items in column direction */
Теперь вы можете использовать grid-column: span 2
дляnavbar
- см. демонстрацию ниже:
* {
box-sizing: border-box;
}
body {
margin: 0;
}
.wrapper {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: auto auto 1fr;
grid-auto-flow: column; /* place grid items in column direction */
grid-column-gap: 9px;
height: 100vh;
}
.navbar {
background: lightseagreen;
color: white;
height: 27px;
grid-column: span 2; /* span both columns */
}
.grid {
background: silver;
}
.divtop {
background: lightgreen;
}
.story {
overflow-y: auto; /* overflow of content */
background: gold;
}
<div class="wrapper">
<div class='navbar'>NAVBAR</div>
<div class='divtop'>TOP</div>
<div class='story'>
some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text
here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some
text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here
</div>
<div class='divtop'>TOP</div>
<div class='story'>
some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text
here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some
text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here
</div>
</div>