Skip to content

Instantly share code, notes, and snippets.

@loloof64
Created September 6, 2021 15:51
Show Gist options
  • Save loloof64/2e82ec70f069aea137e5be7eb4a9703c to your computer and use it in GitHub Desktop.
Save loloof64/2e82ec70f069aea137e5be7eb4a9703c to your computer and use it in GitHub Desktop.
CSS Course Udemy Grid
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CSS Course</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<div id="root">
<div class="header">Header</div>
<div class="sidebar">Sidebar</div>
<div class="main_content">Main content</div>
<div class="footer">Footer</div>
</div>
</body>
</html>
#root {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(3, 1fr);
}
.header {
background-color: aqua;
color: yellow;
grid-column-start: 1;
grid-column-end: span 2;
}
.sidebar {
background-color: blueviolet;
color: yellow;
}
.main_content {
background-color: coral;
color: yellow;
}
.footer {
background-color: olivedrab;
color: yellow;
grid-column-start: 1;
grid-column-end: span 2;
}
#root div {
color: black;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
margin: 2px 5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment