Skip to content

Instantly share code, notes, and snippets.

@cyancey76
Created July 12, 2019 19:02
Show Gist options
  • Save cyancey76/d5c2d4a064028175a878b4ea62fe579a to your computer and use it in GitHub Desktop.
Save cyancey76/d5c2d4a064028175a878b4ea62fe579a to your computer and use it in GitHub Desktop.
Full browser width element with CSS calc()
.container {
max-width: 1200px;
width: calc( 100vw - 4rem );
margin: 0 auto;
}
.container section {
display: block;
max-width: 100%;
}
.container section.breakout {
max-width: 100vw;
margin: 0 calc( -50vw +50% );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment