Skip to content

Instantly share code, notes, and snippets.

@s-hiroshi
Created April 23, 2012 12:01
Show Gist options
  • Save s-hiroshi/2470460 to your computer and use it in GitHub Desktop.
Save s-hiroshi/2470460 to your computer and use it in GitHub Desktop.
CSS > Media Query2
/**
* <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
**/
#foo {
margin: 0 auto;
min-width: 769px;
max-width: 980px;
}
#bar {
/* ..... */
}
#baz {
/* .... */
}
@media only screen (max-width:321px) and (max-width:768px) {
#foo {
min-width: 100%;
max-width: 100%;
}
#bar {
/* ..... */
}
#baz {
visibility: hidden;
}
@media only screen and (max-width:320px) {
#foo {
min-width: 100%;
max-width: 100%;
}
#bar {
visibility: hidden;
}
#baz {
visibility: hidden;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment