Skip to content

Instantly share code, notes, and snippets.

@ef2k
Last active April 15, 2018 20:17
Show Gist options
  • Save ef2k/2a30bdabed0b32e20e9c8e656e9db2e5 to your computer and use it in GitHub Desktop.
Save ef2k/2a30bdabed0b32e20e9c8e656e9db2e5 to your computer and use it in GitHub Desktop.
Mobile first pure CSS container taken from Bootstrap (breakpoints included)
/*
usage: @import url("container.css"); at the top of your base stylesheet
*/
/* ------------ */
/* Mobile first */
/* ------------ */
.container {
padding: 0 50px;
margin-left: auto;
margin-right: auto;
max-width: 420px;
}
/* ------------ */
/* Break points */
/* ------------ */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
.container {
max-width: 540px;
}
}
/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
.container {
max-width: 720px;
}
}
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
.container {
max-width: 960px;
}
}
/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
.container {
max-width: 1140px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment