Skip to content

Instantly share code, notes, and snippets.

@equinusocio
Created October 16, 2020 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save equinusocio/1fc1ddb7a5779fb4bbbb54132ebaf99c to your computer and use it in GitHub Desktop.
Save equinusocio/1fc1ddb7a5779fb4bbbb54132ebaf99c to your computer and use it in GitHub Desktop.
CSS Bleed techniques
/*
* 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