Created
November 14, 2017 11:07
-
-
Save nasitra/6eda1319033c13607bfc876bb9f71158 to your computer and use it in GitHub Desktop.
Responsively change div size keeping aspect ratio
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> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
body { | |
margin: 0; | |
} | |
.content { | |
background-color: green; | |
bottom: 0; | |
height: 56.25vw; | |
left: 0; | |
margin: auto; | |
max-height: 100vh; | |
max-width: 100vw; | |
position: absolute; | |
right: 0; | |
top: 0; | |
width: 177.78vh; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="content"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment