Skip to content

Instantly share code, notes, and snippets.

@fwgreen
Created February 16, 2019 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fwgreen/a91db42a656eed9d99193829468dc4f9 to your computer and use it in GitHub Desktop.
Save fwgreen/a91db42a656eed9d99193829468dc4f9 to your computer and use it in GitHub Desktop.
Basic html5 page with stylesheet
<!DOCTYPE html>
<html>
<head>
<title>Web Page</title>
<link rel="stylesheet" href="styles.css">
<meta name="viewport" content="width=device-width">
</head>
<body>
<main>
<header>header</header>
<nav>navigation</nav>
<article>article</article>
<footer>footer</footer>
</main>
</body>
</html>
body {
margin: 0px;
}
@media screen and (max-width: 40em) {
main {
height: 100vh;
width: 100%;
display: grid;
grid-template-columns: 1fr 4fr;
grid-template-areas: "header header" "article article" "footer footer" "nav nav"
}
}
@media screen and (min-width: 40em) {
main {
height: 100vh;
width: 100%;
display: grid;
grid-template-columns: 1fr 4fr;
grid-template-areas: "header header" "nav article" "footer footer"
}
}
header {
grid-area: header;
background: lightblue;
}
footer {
grid-area: footer;
background: lightcoral;
}
nav {
grid-area: nav;
background: lightgoldenrodyellow;
}
article {
grid-area: article;
background: lightgreen;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment