Simple Responsive Web Design

Just completed my first pass at making my site, ‘Responsive’. For those not familiar with the term, it simply means that I am optimizing my site to dynamically change it’s layout depending on the screen size and device type you are accessing it from.  So users who come to my site from a smart phone will see the site optimized for their device.  Where as someone accessing the site from a traditional PC with a screen size of say 1000px wide, will receive a different view of the site.  This is of course a different approach than redirecting users to a mobile specific version of the site like you might see when you go to The Seattle Times. In that method, users that access from an iPhone will be redirected to for a layout optimized for their device.  Two completely separate pages.  The Responsive method I’m implementing serves up the same page for all device and screen sizes and dynamically adjusts the content and layout as specified. *note, at the time of this blog post, I have not implemented the same responsiveness to this blog.  Let’s call that phase 2.

For this initial pass, I took a very simplified approach. First, I had no desire to completely change the existing fixed width layout and code for my site so I left it as is. Second, I then used media queries to present new layout’s for pixel width breakpoints that I determined through trial and error. For now, I am only targeting traditional smart phone width’s and tablets in portrait mode as the site as-is renders fine in landscape mode. I will at some point need to add in even more breakpoints as the small tablet devices like the Kindle Fire and soon to be released iPad mini, will introduce a new set of users.

If I were to create a site from scratch I would be using fluid grid layouts with images that scale and up and down.  But again, I am retrofitting my existing site and want a simple and effective approach.

My three layouts then are: on a standard laptopExisting. Which looks great on anything at least 911px wide.





Large tablet portrait. Let’s be honest and call it an iPad. Anything less than 910px wide, but greater than #3, which is…


 on an iphoneSmart phone. Which I have set at anything less than 595px wide as the break point but actually the content is only about 286px wide.  I just center it.  Soon I’ll put another breakpoint in at 300px and build a mini-tablet layout for the 300 – 595px range.





To implement this is extremely simple. For each one of the breakpoints listed above, I added a media query to the end of my style sheet in the following format:

@media screen and (max-width: 910px){}

Within the two {} brackets, I grab my already established elements, id’s, classes, etc and apply new style rules to them. Only screens with a width of less than what I specify will render it.

Order matters here, so do these in order from top to bottom with biggest screen size at the top and smallest at the bottom.

For my smart phone view, I actually removed quite a bit of content like an image slideshow and other items and simply achieved this by using the CSS style ‘display:none’ on elements I didn’t want to be shown. Word of warning, just because you are using ‘display:none’ doesn’t mean you aren’t still downloading the entire page contents to the device… you are. I can get away with this on my site because I kept it extremely light to begin with.

You’ll also need to be sure and add a meta viewport tag to your header as follows:

<meta name=”viewport” content=”width=device-width, initial-scale=1.0″ />

If you want to get in deep with Responsive Web Design, then buy this book.

Also, here is a great article in Wikipedia on RWD,

And here is a link to my sites stylesheet. Scroll to the bottom to see the media query pieces.

Lastly, if you want to see RWD in action, load my main page, from a browser on your laptop or desktop and then resize the browser from biggest to smallest, and watch the content change dynamically.