Created
October 16, 2020 12:27
-
-
Save equinusocio/1fc1ddb7a5779fb4bbbb54132ebaf99c to your computer and use it in GitHub Desktop.
CSS Bleed techniques
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
/* | |
* Make the element bleed on both side, | |
* covering the whole viewport width. | |
*/ | |
.FullBleed { | |
margin-left: calc(50% - 50vw); | |
width: 100vw; | |
} | |
/* | |
* Make the element bleed on both side, | |
* but controlling the max width | |
*/ | |
.ControlledBleeding { | |
width: 100vw; | |
max-width: 60ch; | |
margin-left: 50%; | |
transform: translateX(-50%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment