Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Gameonn/29cc228d7adb8338e333ee2f873d46d9 to your computer and use it in GitHub Desktop.
Save Gameonn/29cc228d7adb8338e333ee2f873d46d9 to your computer and use it in GitHub Desktop.
CSS Grid Intro Challenge M1- Line Numbers
<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>
: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