Last active
August 27, 2021 14:52
-
-
Save shreshthmohan/c4972e3f636c388a84b5534c89ab16ef to your computer and use it in GitHub Desktop.
Full-width child
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
.full-width { | |
/* This display style is optional */ | |
display: flex; | |
/* Note: - 20px and + 10px is done to avoid the div creating an extra x-scoll bar */ | |
width: calc(100vw - 20px); | |
margin-left: calc((100% - 100vw) / 2 + 10px); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use:
Simply add a div with a class of
full-width
and use this CSS snippet along with that.