Created
April 28, 2022 06:44
-
-
Save itsdonnix/6120794f210c7bb0a3e9106f751ba338 to your computer and use it in GitHub Desktop.
CSS Container Trick
This file contains hidden or 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: 60rem; | |
--padding: 2rem; | |
max-width: min(100% - var(--padding), var(--max-width)); | |
margin-inline: auto; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment