On Github TownHack / rwd-101
Presented by David Myers and Zackary Lowery at Town Hack Columbus 2014
This presentation is available online at https://townhack.github.io/rwd-101/#/
Responsive Web Design: The practice of designing flexible layouts that are adaptable to any device, any viewport, or even to any environment.
* This example will only work in the Firefox Web Browser
- What is Responsive Web Design? - Not about designing for mobile - Not even about designing for desktops - It's about a better practice; taking dynamic to the next levelThere are too many devices and screen sizes to predict every possible outcome
- Websites are meant to be dynamicDesktop no longer dominates the realm of web browsers
- Something needs to change - We can't keep trying to develop for each possible outcome independentlyMedia Queries allow you to test the device for certain properties...
...and use the results to help change the layout or style with CSS.
body { background-color: #ddd; } @media all and (min-width: 50rem) { body { background-color: #444; } }
Screens less than 50rem wide will have a light background.
Screens 50rem or wider will have a dark background.
Inside a CSS file or Style block
@media all and (min-width: 50rem) { body { background-color: #444; } }
Inside the link tag
<link media="all and (min-width: 50rem)" href="large.css" rel="stylesheet">
In combination with the @import statement
@import url('large.css') all and (min-width: 50rem);
<meta name="viewport" content="width=device-width, initial-scale=1.0">