Skip to content

Instantly share code, notes, and snippets.

@adityabhaskar
Created May 19, 2020 15:16
Show Gist options
  • Save adityabhaskar/6d37d7eae3b2f5f4b6cc7c64855d5583 to your computer and use it in GitHub Desktop.
Save adityabhaskar/6d37d7eae3b2f5f4b6cc7c64855d5583 to your computer and use it in GitHub Desktop.
Basic centred webpage css
body {
/* content width is 2x 350px */
margin: auto calc(50% - 350px);
color: rgba(0, 0, 0, .8);
font-size: 16px;
font-family: system-ui, 'Roboto', sans-serif;
line-height: 1.6;
}
@media (max-width: 767px) {
body {
margin: auto 2rem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment