Created
August 17, 2022 10:31
-
-
Save AakashRao-dev/f12d60e7454cdfc044bd01009dc2f420 to your computer and use it in GitHub Desktop.
Mock layout Source Code to learn about CSS Grid
This file contains hidden or 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
<!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" /> | |
<link rel="stylesheet" href="./style.css" /> | |
<title>CSS Grid basic layout</title> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="header">Header</div> | |
<div class="menu">Menu</div> | |
<div class="aside">Aside</div> | |
<div class="content">Content</div> | |
<div class="footer">Footer</div> | |
</div> | |
</body> | |
</html> |
This file contains hidden or 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
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
.container > div { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
font-size: 2rem; | |
color: #ffeead; | |
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | |
} | |
html, | |
body { | |
background: #ffeead; | |
height: 100%; | |
padding: 10px; | |
} | |
.container > div:nth-child(1n) { | |
background: #ce96ca; | |
} | |
.container > div:nth-child(3n) { | |
background: #88d8b0; | |
} | |
.container > div:nth-child(2n) { | |
background: #ff6f69; | |
} | |
.container > div:nth-child(4n) { | |
background: #ffcc5c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment