Skip to content

Instantly share code, notes, and snippets.

@oshihirii
Last active June 6, 2016 14:35
Show Gist options
  • Save oshihirii/ce1c8c38d5bb7b99f3b2adbe64c69e1e to your computer and use it in GitHub Desktop.
Save oshihirii/ce1c8c38d5bb7b99f3b2adbe64c69e1e to your computer and use it in GitHub Desktop.
solutions to commonly encountered css scenarios
/* vertical align button in absolute div */
/* https://css-tricks.com/centering-css-complete-guide */
/* whitespace between inline-blocks */
/* remove padding and margin from page */
html,body {
height: 100%;
margin: 0;
padding: 0;
overflow-x: hidden;
}
/* set border-box for all elements */
*,:before,:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* media queries */
/* (http://cssmediaqueries.com/what-are-css-media-queries.html) */
/* (https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries) */
/* (http://getskeleton.com/#queries) */
/* mobile first queries */
/* larger than mobile */
@media (min-width: 400px) {
}
/* larger than phablet */
@media (min-width: 550px) {
}
/* larger than tablet */
@media (min-width: 750px) {
}
/* larger than desktop */
@media (min-width: 1000px) {
}
/* larger than desktop hd */
@media (min-width: 1200px) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment