Last active
October 8, 2016 08:33
-
-
Save zhentian-wan/616f83e1298916d14a97d876064e9740 to your computer and use it in GitHub Desktop.
CSS calc
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>GistRun</title> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> | |
<nav> | |
nav | |
</nav> | |
<main> | |
main | |
</main> | |
<aside> | |
aside | |
</aside> | |
<script src="script.js"></script> | |
</body> | |
</html> |
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
console.log('Hello World!'); |
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
nav{ | |
background: yellow; | |
position: fixed; | |
top: 0; | |
left: 0; | |
height: 100%; | |
width: 5rem; | |
} | |
main{ | |
background: red; | |
width: calc(100% - 25rem); | |
margin-left: 5rem; | |
} | |
aside{ | |
background: blue; | |
width: 20rem; | |
position: fixed; | |
top: 0; | |
right: 0; | |
height: 100%; | |
} | |
@media (max-width: 600px){ | |
aside{ | |
width: 8rem; | |
} | |
nav{ | |
width: 3rem; | |
} | |
main{ | |
width: calc(100%-11rem); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment