Skip to content

Instantly share code, notes, and snippets.

@hereischen
Created March 8, 2021 11:14
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 hereischen/7a8e2e6ee638f734117f0b4b780a2a86 to your computer and use it in GitHub Desktop.
Save hereischen/7a8e2e6ee638f734117f0b4b780a2a86 to your computer and use it in GitHub Desktop.
:root {
box-sizing: border-box; // 1
}
*,
::before,
::after {
box-sizing: inherit; // 2
}
// 1 Applies border box sizing to the root element
// 2 Tells all other elements and pseudo-elements to inherit their box sizing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment