Skip to content

Instantly share code, notes, and snippets.

@sangress
Created May 30, 2016 20:21
Show Gist options
  • Save sangress/35ba7b22c4e687f5a96abefd98602f91 to your computer and use it in GitHub Desktop.
Save sangress/35ba7b22c4e687f5a96abefd98602f91 to your computer and use it in GitHub Desktop.
media_queries_ex
body {
display: flex;
justify-content: center;
align-items: center;
}
div {
width: 400px;
height: 400px;
border: 1px dashed green;
}
div p {
font-size: 1em;
color: #000;
}
/* tablets and mobile phones */
@media (max-width: 768px) {
div {
background-color: darkgoldenrod;
}
div p {
font-size: 2em;
color: #fff;
}
}
/*And operator*/
/*@media (min-width: 700px) and (orientation: landscape) { ... }*/
/*Only*/
/*<link rel="stylesheet" media="only screen and (color)" href="example.css" />*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment