Skip to content

Instantly share code, notes, and snippets.

@maxxcrawford
Created November 22, 2016 16:10
Show Gist options
  • Save maxxcrawford/7e3de4aa8960c9db51efb6083feb3484 to your computer and use it in GitHub Desktop.
Save maxxcrawford/7e3de4aa8960c9db51efb6083feb3484 to your computer and use it in GitHub Desktop.
Use vh/vw to break out of container
* {
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