{"id":6504,"date":"2015-05-26T16:35:13","date_gmt":"2015-05-26T23:35:13","guid":{"rendered":"http:\/\/proxystudio.uxpin.com\/?p=6504"},"modified":"2023-08-28T06:33:49","modified_gmt":"2023-08-28T13:33:49","slug":"media-queries-responsive-web-design","status":"publish","type":"post","link":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/","title":{"rendered":"How to Use Media Queries in Responsive Web Design"},"content":{"rendered":"<p><a href=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6505 size-full\" src=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg\" alt=\"Device landscape\" width=\"900\" height=\"675\" \/><\/a><\/p>\n<p>Photo credit:<strong> <a href=\"https:\/\/www.flickr.com\/photos\/adactio\/6153481666\">Jeremy Keith<\/a>, <a href=\"https:\/\/creativecommons.org\/licenses\/by\/2.0\/\">Creative Commons <\/a>\u00a0<\/strong><\/p>\n<p><a href=\"https:\/\/www.uxpin.com\/studio\/blog\/responsive-vs-adaptive-design-whats-best-choice-designers\/\">Responsive web design<\/a> has exploded\u00a0in popularity \u2014 thanks to the need to create sites that work across numerous devices.<\/p>\n<p>However, responsive design comes with some problems of its own. The <a href=\"http:\/\/www.guypo.com\/real-world-rwd-performance-take-2\">issue of slow-to-load sites<\/a> is now well documented. Let&#8217;s walk\u00a0through <a href=\"http:\/\/www.smashingmagazine.com\/2014\/07\/responsive-web-design-should-not-be-your-only-mobile-strategy\/\">some of the tricks designers are using<\/a> to better load content and images on different devices.<\/p>\n<p><!--more--><\/p>\n<h2>Media Queries to Call Styles<\/h2>\n<p>One of these tricks is the use of media queries, which work to call styles to the user device based on its dimensions. There has been some debate in the past on whether media queries are the best solution when it comes to mobile-first, and that <a href=\"http:\/\/hugogiraudel.com\/2014\/04\/22\/why-element-queries-matter\/\">debate still continues<\/a>. However, the Responsive Issues Community Group (RICG) and W3C have looked at ways to implement element queries, which some <a href=\"http:\/\/www.smashingmagazine.com\/2013\/06\/media-queries-are-not-the-answer-element-query-polyfill\/\">believe would be a better solution<\/a>. Why? Because they don\u2019t depend on the viewport, but on the container within it. Media queries are a simple and effective way to serve different content to a range of devices and the most commonly used queries are those that deal with the viewport\u2019s height and width.<\/p>\n<h2><strong><b>Call Using External Stylesheet or in a Stylesheet<\/b><\/strong><\/h2>\n<p>Like we described in the free e-book\u00a0<a href=\"https:\/\/www.uxpin.com\/studio\/ebooks\/mobile-design-patterns\/\">Mobile UI Patterns<\/a>, media queries first check the media type against the user agent string before going on to check for the physical attributes of the viewport. They are a CSS declaration that can be called using an external stylesheet, or be written directly inside a stylesheet.<\/p>\n<p>For example, the external call would look like this:<\/p>\n<p><strong>&lt;link rel=\u201dstylesheet\u201d media=\u201dscreen and (min-width:320px) and (max-width:480px) \u201chref=\u201dcss\/yourstylesheet.css\u201d \/&gt;<\/strong><\/p>\n<p>And the CSS direct call would look like this:<\/p>\n<p><strong>1 @media screen and (min-width:320px)<\/strong><\/p>\n<p><strong>2 and (max-width:480px){<\/strong><\/p>\n<p><strong>3\/*Insert your styles here<\/strong><\/p>\n<p><strong>4 }<\/strong><\/p>\n<p>Here we can see that these CSS declarations are called <i>only <\/i>for devices with those height and width properties. Media queries are not modular, so this can make them difficult to work with, as discussed by Ian Storm Taylor. However, others are pushing for the use of elemental queries, <a href=\"http:\/\/www.sitepoint.com\/beyond-media-queries-time-get-elemental\/\">as pointed out by Richa Jain in her excellent article &#8220;Beyond Media Queries \u2014 It&#8217;s Time to Get Elemental.&#8221;<\/a> But it\u2019ll be some time before we see them implemented, if indeed they are at all, so for the moment we\u2019re stuck with media queries and the issues that surround their use.<\/p>\n<h2><b>Element Queries Not Yet Supported<\/b><\/h2>\n<p>There have been some innovative developers out there who have come up with workarounds, such as Tyson Matanich, who has come up with \u00a0<a href=\"https:\/\/github.com\/tysonmatanich\/elementQuery\">an element query \u2018polyfill\u2019<\/a>.<\/p>\n<p>Other workarounds include (<a href=\"http:\/\/www.sitepoint.com\/beyond-media-queries-time-get-elemental\/\">found thanks to Richa Jain<\/a>):<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/filamentgroup\/elementary\">Elementary<\/a> by Scott Jehl<\/li>\n<li><a href=\"https:\/\/github.com\/Snugug\/eq.js\">EQ.js<\/a> by Sam Richards<\/li>\n<li><a href=\"https:\/\/github.com\/marcj\/css-element-queries\">CSS Element Queries<\/a> from Marcj<\/li>\n<\/ul>\n<p>An element query is similar to a media query because it uses CSS when certain conditions are met. However, they are based on <i>elements rather than the browser, <\/i>which are currently unsupported in CSS3. <a href=\"http:\/\/www.xanthir.com\/b4PR0\">Element queries\u00a0<\/a>are\u00a0gaining momentum, especially since they complement media queries. This means that both can eventually work together to create more modular and flexible designs.<\/p>\n<h2><b>Getting Started With Media Queries<\/b><\/h2>\n<p>First, it\u2019s important to understand the difference between media queries based on \u2018width\u2019 and \u2018device-width\u2019. The former describes the width of a mobile devices\u2019 <i>rendering surface<\/i>, while the latter describes the device\u2019s actual screen width.<\/p>\n<p><a href=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6506 size-full\" src=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices-2.jpg\" alt=\"mobile devices\" width=\"900\" height=\"600\" \/><\/a><\/p>\n<p>Photo Credit: <a href=\"https:\/\/www.flickr.com\/photos\/tribehut\/8091234505\">Tribehut<\/a>, <a href=\"https:\/\/creativecommons.org\/licenses\/by-sa\/2.0\/\">Creative Commons <\/a><\/p>\n<p>In other words, you\u2019ll only be applying a rule to the width of a document window using the \u2018width\u2019 media query. Whereas with \u2018device-width\u2019, you\u2019ll be using the <i>entire <\/i>screen. It\u2019s an important distinction to make. That\u2019s because \u2018device-widths\u2019 don\u2019t always match the viewport layout and could really impact your design. See a more in-depth explanation in <a href=\"http:\/\/www.sitepoint.com\/media-queries-width-vs-device-width\/\">Ryan Reese\u2019s SitePoint article.<\/a><\/p>\n<p>As Ryan points out:<\/p>\n<blockquote><p>&#8220;For reference, you should know that the iPhone 4 has a regular screen layout viewport of 640\u00d7960. This means that, in this example, the device-width of the iPhone4 is 320\u00d7480. This is the case because Apple realizes that not every website is built responsively (shame on them) and tries to please everyone by having around 980px width to accommodate the desktop view of the website. This means, that if there is no meta viewport tag in place, the iPhone4 will take your website, render it as if it were 980px wide, squish it into a 320px display, and as a result, would be zoomed out to the user.&#8221;<\/p><\/blockquote>\n<p>However, you don&#8217;t have to be constrained by using device-based media queries. You can implement media queries on resolutions that break the layout, no matter the screen size. For example, the responsive framework Foundation has media queries based on three core breakpoints \u2014 <a href=\"http:\/\/foundation.zurb.com\/apps\/docs\/#!\/media-queries\">small, medium and large<\/a>. Small covers all screens. Medium covers screens 640px or wider. Large covers screens 1024px or wider.<\/p>\n<section class=\"uxpin-trial-widget\"><h2>Join the world's best designers who&nbsp;use UXPin.<\/h2><span class=\"white-info\">Sign up for a free trial.<\/span><a href=\"https:\/\/www.uxpin.com\/sign-up\" class=\"btn btn-flat sign-up-btn white\">Try it for free!<\/a><\/section>\n<h2><strong><b>Adding Queries for Different Viewports<\/b><\/strong><\/h2>\n<p><a href=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/image00.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6507 size-full\" src=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/image00.png\" alt=\"Adding Queries for Different Viewports\" width=\"650\" height=\"607\" \/><\/a><\/p>\n<p>As you can see, we\u2019ve added queries for landscape and portrait viewports, as well as set parameters for some common screen sizes. Around five sizes will cover most devices, but you can include as many as you like. You can also add additional styles according to how you want the content to look on each device.<\/p>\n<p>For example, if you want the content on a mobile device to be displayed in a certain font or you want a different background color, then add the following under where we\u2019ve marked \/* add your style here *\/:<\/p>\n<p><strong>1 .site-content {<\/strong><\/p>\n<p><strong>2 font-family: Georgia;<\/strong><\/p>\n<p><strong>3 background: blue;<\/strong><\/p>\n<p><strong>4 }<\/strong><\/p>\n<h2>Working With Images<\/h2>\n<p>Scaling images for responsive design is simple enough. However, there are few issues to look out for, such as loss of detail and images being squeezed down to fit the container while taking up most of the page on smaller devices.<\/p>\n<p>To create scalable images, simply add the following code to your stylesheet:<\/p>\n<p><strong>1 img {<\/strong><\/p>\n<p><strong>2 \u00a0\u00a0\u00a0\u00a0max-width: 100%;<\/strong><\/p>\n<p><strong>3 }<\/strong><\/p>\n<p>This will scale down the image to fit within a container that is smaller than the image\u2019s width. Setting the max-width to 100% means that the image won\u2019t scale up any bigger than its actual size when called for larger viewports.<\/p>\n<p>However, this can be a problem when it comes to site performance because you\u2019re essentially delivering a full-size image to every device. There\u2019s no one simple solution to this, especially if you\u2019re working on a site which has legacy images. However, <a href=\"http:\/\/adaptive-images.com\/\">Adaptive Images<\/a> is a plugin which can optimize your images based on screen sizes and has an excellent reputation. And the responsive framework Foundation also <a href=\"http:\/\/foundation.zurb.com\/docs\/components\/interchange.html\">allows you to swap images based on screen sizes<\/a>.<\/p>\n<p>When working with images you should use SVG, web fonts, web type and CSS wherever possible. For further reading, check out <a href=\"https:\/\/css-tricks.com\/which-responsive-images-solution-should-you-use\/\">Chris Coyier\u2019s post<\/a> on CSS-Tricks and <a href=\"http:\/\/www.smashingmagazine.com\/2013\/07\/choosing-a-responsive-image-solution\/\">Sherri Alexander\u2019s Smashing Magazine article<\/a>.<\/p>\n<h2><strong><b>Other Media Queries<\/b><\/strong><\/h2>\n<p>Can I Use has a <a href=\"http:\/\/caniuse.com\/#feat=css-mediaqueries\">complete list of browsers and the media queries<\/a> that they support, as well as usage stats for various countries around the globe and their known issues.<\/p>\n<p><a href=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/media-queries.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6508 size-full\" src=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/media-queries.png\" alt=\"media queries\" width=\"900\" height=\"448\" \/><\/a><\/p>\n<p>Image source: <a href=\"http:\/\/caniuse.com\/#feat=css-mediaqueries\">Can I Use<\/a><\/p>\n<p>You can also find a complete list of media queries and if they are supported or not on <a href=\"http:\/\/cssmediaqueries.com\/overview.html\">CSS Media Queries<\/a>. There\u2019s also an area where you can test out queries that you\u2019ve created too.<\/p>\n<h2><b>Take Care With Performance<\/b><\/h2>\n<p>Media queries are used in responsive web design, which allows for a site to be viewed on a variety of screen sizes and browsers. As we said, media queries aren\u2019t modular, so this can cause design issues that can be difficult to work around. There are a huge amount of resources to be found online to help you with this, such as code snippets and <a href=\"http:\/\/webdesigncube.com\/2014\/best-responsive-html5-frameworks\/\">frameworks<\/a>.<\/p>\n<p>It\u2019s important when working with media queries to ensure that you understand performance and its impact on UX and conversions. A slow loading site will <a href=\"https:\/\/www.digitalcommerce360.com\/2020\/08\/21\/most-consumers-abandon-a-slow-loading-ecommerce-site\/\" target=\"_blank\" rel=\"noopener\">frustrate users and have them abandon their purchases.<\/a>\u00a0And that will end up costing the owner a lot of cash in lost revenue<\/p>\n<p>The mobile revolution has ensured that we will no longer tolerate a horrible web experience. When designing a responsive site, you should consider using conditional loading to reduce the amount of content that\u2019s sent to a target device.<\/p>\n<p>Social media sharing buttons slow sites down too, <a href=\"http:\/\/zurb.com\/article\/883\/small-painful-buttons-why-social-media-bu\">especially on mobile<\/a>. Just three social buttons for Facebook, Twitter and G+ make up a total of <a href=\"http:\/\/www.narga.net\/how-to-avoid-being-slowed-down-by-social-media-buttons\/\">19 requests and take 246.7k in bandwidth<\/a>. With this in mind, consider using web fonts on your front page for your social media URLs rather than images and limit the number of sharing buttons on your blog posts.<\/p>\n<p>Alternatively you can use <a href=\"http:\/\/www.narga.net\/25-useful-jquery-social-share-plugins\/\">jQuery plugins<\/a> to speed the social media sharing buttons up a little.<\/p>\n<p>There are tons of online tutorials to help you with responsive web design and media queries. We hope we\u2019ve given you a great starting point so you can get going with media queries.<\/p>\n<p>If you&#8217;d like to learn more about front-end visual design, take a look at our free e-book <a href=\"https:\/\/www.uxpin.com\/studio\/ebooks\/mobile-design-patterns\/\">Mobile UI Patterns<\/a>.\u00a0We&#8217;ve analyzed 46 of the most effective yet flexible design patterns based on their use by top companies like Spotify, Pinterest, Uber, Instagram, Flipboard, and many others.<\/p>\n<section class=\"uxpin-trial-widget\"><h2>Join the world's best designers who&nbsp;use UXPin.<\/h2><span class=\"white-info\">Sign up for a free trial.<\/span><a href=\"https:\/\/www.uxpin.com\/sign-up\" class=\"btn btn-flat sign-up-btn white\">Try it for free!<\/a><\/section>\n","protected":false},"excerpt":{"rendered":"<p>Photo credit: Jeremy Keith, Creative Commons \u00a0 Responsive web design has exploded\u00a0in popularity \u2014 thanks to the need to create sites that work across numerous devices. However, responsive design comes with some problems of its own. The issue of slow-to-load sites is now well documented. Let&#8217;s walk\u00a0through some of the tricks designers are using to<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11,4,6,19,7],"tags":[],"class_list":["post-6504","post","type-post","status-publish","format-standard","hentry","category-blog","category-tutorials","category-ui-design","category-ux-design","category-uxpin","category-web-design"],"yoast_title":"","yoast_metadesc":"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.","acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.5 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Use Media Queries in Responsive Web Design | UXPin<\/title>\n<meta name=\"description\" content=\"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use Media Queries in Responsive Web Design\" \/>\n<meta property=\"og:description\" content=\"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/\" \/>\n<meta property=\"og:site_name\" content=\"Studio by UXPin\" \/>\n<meta property=\"article:published_time\" content=\"2015-05-26T23:35:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-28T13:33:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg\" \/>\n<meta name=\"author\" content=\"Ryan Riddle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ryan Riddle\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/\"},\"author\":{\"name\":\"Ryan Riddle\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/#\\\/schema\\\/person\\\/133da71f4094affa0b21499f1792c70a\"},\"headline\":\"How to Use Media Queries in Responsive Web Design\",\"datePublished\":\"2015-05-26T23:35:13+00:00\",\"dateModified\":\"2023-08-28T13:33:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/\"},\"wordCount\":1529,\"image\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/devices.jpg\",\"articleSection\":[\"Blog\",\"Tutorials\",\"UI Design\",\"UX Design\",\"UXPin\",\"Web Design\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/\",\"url\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/\",\"name\":\"How to Use Media Queries in Responsive Web Design | UXPin\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/devices.jpg\",\"datePublished\":\"2015-05-26T23:35:13+00:00\",\"dateModified\":\"2023-08-28T13:33:49+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/#\\\/schema\\\/person\\\/133da71f4094affa0b21499f1792c70a\"},\"description\":\"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/devices.jpg\",\"contentUrl\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/wp-content\\\/uploads\\\/2015\\\/05\\\/devices.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/blog\\\/media-queries-responsive-web-design\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use Media Queries in Responsive Web Design\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/#website\",\"url\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/\",\"name\":\"Studio by UXPin\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/#\\\/schema\\\/person\\\/133da71f4094affa0b21499f1792c70a\",\"name\":\"Ryan Riddle\",\"description\":\"Ryan Thomas Riddle is the Head of Marketing at UXPin. He is an award-winning writer for his work as a mild-mannered reporter for the Bay Area newspaper, The Daily Post. His previous work has appeared in the San Francisco Bay Guardian. Formerly, he worked for ZURB, a digital product design company, as their Lead Editor. You can read all about his adventures through time and space on Twitter, @ryantriddle.\",\"url\":\"https:\\\/\\\/www.uxpin.com\\\/studio\\\/author\\\/ryanriddle\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use Media Queries in Responsive Web Design | UXPin","description":"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/","og_locale":"en_US","og_type":"article","og_title":"How to Use Media Queries in Responsive Web Design","og_description":"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.","og_url":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/","og_site_name":"Studio by UXPin","article_published_time":"2015-05-26T23:35:13+00:00","article_modified_time":"2023-08-28T13:33:49+00:00","og_image":[{"url":"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg","type":"","width":"","height":""}],"author":"Ryan Riddle","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ryan Riddle","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#article","isPartOf":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/"},"author":{"name":"Ryan Riddle","@id":"https:\/\/www.uxpin.com\/studio\/#\/schema\/person\/133da71f4094affa0b21499f1792c70a"},"headline":"How to Use Media Queries in Responsive Web Design","datePublished":"2015-05-26T23:35:13+00:00","dateModified":"2023-08-28T13:33:49+00:00","mainEntityOfPage":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/"},"wordCount":1529,"image":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#primaryimage"},"thumbnailUrl":"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg","articleSection":["Blog","Tutorials","UI Design","UX Design","UXPin","Web Design"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/","url":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/","name":"How to Use Media Queries in Responsive Web Design | UXPin","isPartOf":{"@id":"https:\/\/www.uxpin.com\/studio\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#primaryimage"},"image":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#primaryimage"},"thumbnailUrl":"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg","datePublished":"2015-05-26T23:35:13+00:00","dateModified":"2023-08-28T13:33:49+00:00","author":{"@id":"https:\/\/www.uxpin.com\/studio\/#\/schema\/person\/133da71f4094affa0b21499f1792c70a"},"description":"A quick guide on how to implement media queries in responsive web design with several practical code tips and tricks. Read the advice from UXPin experts.","breadcrumb":{"@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#primaryimage","url":"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg","contentUrl":"https:\/\/www.uxpin.com\/studio\/wp-content\/uploads\/2015\/05\/devices.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.uxpin.com\/studio\/blog\/media-queries-responsive-web-design\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.uxpin.com\/studio\/"},{"@type":"ListItem","position":2,"name":"How to Use Media Queries in Responsive Web Design"}]},{"@type":"WebSite","@id":"https:\/\/www.uxpin.com\/studio\/#website","url":"https:\/\/www.uxpin.com\/studio\/","name":"Studio by UXPin","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.uxpin.com\/studio\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.uxpin.com\/studio\/#\/schema\/person\/133da71f4094affa0b21499f1792c70a","name":"Ryan Riddle","description":"Ryan Thomas Riddle is the Head of Marketing at UXPin. He is an award-winning writer for his work as a mild-mannered reporter for the Bay Area newspaper, The Daily Post. His previous work has appeared in the San Francisco Bay Guardian. Formerly, he worked for ZURB, a digital product design company, as their Lead Editor. You can read all about his adventures through time and space on Twitter, @ryantriddle.","url":"https:\/\/www.uxpin.com\/studio\/author\/ryanriddle\/"}]}},"_links":{"self":[{"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/posts\/6504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/comments?post=6504"}],"version-history":[{"count":3,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/posts\/6504\/revisions"}],"predecessor-version":[{"id":49744,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/posts\/6504\/revisions\/49744"}],"wp:attachment":[{"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/media?parent=6504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/categories?post=6504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uxpin.com\/studio\/wp-json\/wp\/v2\/tags?post=6504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}