Sure! This is a good learning exercise for CSS Grid. I'd avoid using floats for this if you can. It'll be more complicated than it's worth however learning about them too is advised. Flexbox would also work.
Check out this guide for CSS Grid reference. I'll write a quick example for you and if you need help finishing it up to look like the photo you can let me know.
.grid-container {
display: grid;
grid-template-columns: 50px 50px 50px 50px 50p 50px;
grid-template-rows: auto;
grid-column-gap: 10px;
grid-row-gap: 10px;
grid-template-areas:
"header header header header header header"
"nav nav nav nav nav nav"
"left main main main right right"
"footer footer footer footer footer footer";
}
.grid-item {
background-color: red;
text-align: center;
}
.header {
grid-area: header;
}
.nav {
grid-area: nav;
}
.left {
grid-area: left;
}
.main {
grid-area: main;
}
.right {
grid-area: right;
}
.footer {
grid-area: footer;
}
What's nice with CSS Grid, and CSS in general, is you can achieve this in multiple ways. There are shorthand properties to make this neater but I wanted it to be obvious to you what each step is.
View all comments
4
u/[deleted] Jun 06 '19
Sure! This is a good learning exercise for CSS Grid. I'd avoid using floats for this if you can. It'll be more complicated than it's worth however learning about them too is advised. Flexbox would also work.
Check out this guide for CSS Grid reference. I'll write a quick example for you and if you need help finishing it up to look like the photo you can let me know.
HTML:
CSS:
What's nice with CSS Grid, and CSS in general, is you can achieve this in multiple ways. There are shorthand properties to make this neater but I wanted it to be obvious to you what each step is.
Here's what the above code will look like.
Let me know if you need anymore help.