1.3: Layouts
Creating site layout using what you have learned!
Flexbox
Adjust your code to reflect the following:
<div class=wrapper>
<header class="header">Header</header>
<article>
<div class="main">
<div class="child"></div>
</div>
</article>
<aside class="aside aside-1">1<aside>
<aside class="aside aside-2">2<aside>
<footer class="footer">Footer</footer>
</div>body{
background: #fff;
color: #fff;
font-size: 250%;
text-align: center;
padding: 2em;
}
.wrapper * {
flex: 1 100%;
}
.header {
border-bottom: 3px solid white;
background: #2c3e50;
}
.footer {
border-top: 3px solid white;
background:#061539;
}
.child{
width: 100px;
height: 100px;
border-left: 2px solid white;
border-right: 2px solid white;
margin: auto;
background: #7887ab;
}
.main {
background: #2e4272;
}
.aside-1{
border-top: 3px solid white;
background: #162955;
}
.aside-2 {
border-top: 3px solid white;
background: #4f628e;
}
Grid
Properties: grid-area, grid-gap, grid-template-columns, grid-template-rows, grid-template-areas
Explore More
Implicit & Explicit grids
flex-shrink, flex-grow, flex-basis
nested grids
auto templates
Challenges
Gold: Create the same layout using grid line numbers
Blue: Create the same layout using grid named lines
Red: Create a layout using both flexbox and grid
Last updated