Skip to content

Instantly share code, notes, and snippets.

@endigo9740
Created March 7, 2012 18:16
Show Gist options
  • Save endigo9740/1994839 to your computer and use it in GitHub Desktop.
Save endigo9740/1994839 to your computer and use it in GitHub Desktop.
CSS: Media Queries
<!-- Via Link Tag -->
<link rel="stylesheet" href="handheld.css" media="only screen and (max-device-width:480px)"/>
<!-- Via CSS Media Queries -->
<style type="text/css">
/* Width */
@media (max-width: 1024px) { body {width: 1024px;} } /* Landscape */
@media (max-width: 768px) { body {width: 768px;} } /* Portrait */
/* Width & Orientation */
@media (max-device-width: 1024px) and (orientation: landscape) { body {width: 1024px; }
@media (max-device-width: 768px) and (orientation: portrait) { body {width: 768px; }
@media only screen and (max-device-width: 480px) {
/* CSS goes here… */
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment