Created
November 22, 2016 16:10
-
-
Save maxxcrawford/7e3de4aa8960c9db51efb6083feb3484 to your computer and use it in GitHub Desktop.
Use vh/vw to break out of container
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
* { | |
box-sizing: border-box; | |
} | |
/* This technique doesn't naturally cause horizontal overflow, but once there is natural vertical overflow, it causes horizontal overflow, so stopping here. */ | |
body { | |
overflow-x: hidden; | |
} | |
img { | |
max-width: 100%; | |
} | |
main { | |
max-width: 600px; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.full-width { | |
width: 100vw; | |
position: relative; | |
left: 50%; | |
right: 50%; | |
margin-left: -50vw; | |
margin-right: -50vw; | |
} | |
p, figure { | |
margin: 15px 0; | |
} | |
figcaption { | |
text-align: center; | |
color: #999; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment