Created
July 12, 2019 19:02
-
-
Save cyancey76/d5c2d4a064028175a878b4ea62fe579a to your computer and use it in GitHub Desktop.
Full browser width element with 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
.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