A Pen by Ankit Jindal on CodePen.
Created
July 16, 2022 12:58
-
-
Save Gameonn/29cc228d7adb8338e333ee2f873d46d9 to your computer and use it in GitHub Desktop.
CSS Grid Intro Challenge M1- Line Numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container"> | |
<div class="header">Header</div> | |
<div class="small-box small-box-1">Small Box 1</div> | |
<div class="small-box small-box-2">Small Box 2</div> | |
<div class="small-box small-box-3">Small Box 3</div> | |
<div class="sidebar">Sidebar</div> | |
<div class="content"> | |
Main Content | |
</div> | |
<div class="footer">Footer</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--pad: 1rem 2rem; | |
--bgcolor: orangered; | |
} | |
@mixin common { | |
background: var(--bgcolor); | |
padding: var(--pad); | |
} | |
.container { | |
background: #eee; | |
width: 800px; | |
display: grid; | |
margin: 30px auto; | |
grid-gap: 30px; | |
grid-template-rows: 1fr 1.5fr 3fr 1fr; | |
grid-template-columns: repeat(3, 190px) 1fr; | |
font-size: 20px; | |
color: #fff; | |
font-family: sans-serif; | |
& > * { | |
@include common; | |
} | |
} | |
.header { | |
grid-column: 1/-1; | |
} | |
.sidebar { | |
// grid-row: 2/-2; | |
grid-row: 2/span 2; | |
} | |
.content { | |
grid-row: 3/4; | |
// grid-column: 1/-2; | |
grid-column: 1/span 3; | |
} | |
.footer { | |
grid-column: 1/-1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment