I am learning CSS grids. So far I love it. But I am facing an issue with the line number.
I have defined my inline-grid
by this:
grid-template-columns: repeat(7, 60px);
grid-template-rows: repeat(4, 60px);
=> There are 7 columns, so the final line number should be 8
. But it's showing 10
.
=> There are 4 rows, so the final row line number should be 5
. It's showing 7
(In -ve
numbers, it showing correctly for both rows & columns, -1/-8
& -1/-5
respectively)
Trying to fix this since yesterday evening. Please help me
.container {
margin: 110px 270px;
display: inline-grid;
grid-template-columns: repeat(7, 60px);
grid-template-rows: repeat(4, 60px);
background-color: violet;
grid-template-areas: "header header header header header header header";
}
.header {
grid-area: header;
background-color: brown;
}
.main {
grid-area: main;
}
.sidebar {
grid-area: sidebar;
}
.footer {
grid-area: footer;
}
<body>
<div class="container">
<div class="header"></div>
<div class="main"></div>
<div class="sidebar"></div>
<div class="footer"></div>
</div>
</body>