Going from adaptive to fully responsive
Back in April I wrote a post about experimenting with responsive web design, and how my website responded, or adapted, to different devices and browser widths.
After reading Ethan Marcotte’s Responsive Web Design book, I realised that there is a difference between responsive and adaptive web design.
According the Ethan, who also coined the phrase “Responsive Web Design”, there are three components to a responsive design:
- A flexible, grid-based layout
- Flexible images and media
- Media queries
Flexible is the keyword
Until recently I had a site that adapted to the user’s device, depending on the available screen width. If it was less than or equal to 480px, the site would adapt and styles would change to suit that user who were more than likely on a mobile device. Anyone else was served the normal 960px width site.
The CSS looked a bit like this:
@media only screen and (max-width: 480px) {
INSERT MOBILE STYLES HERE
}But there was nothing flexible about this approach. It adapted to one other screen size, it didn’t respond to varying screen sizes.
Target/context = result
Instead of setting widths and type in pixels, which are fixed, set widths and type in percentages or ems.
This will give you a flexible design, and the widths and sizes will automatically respond depending on their relative bounding box.
After reading Ethan’s book I spent little over 1 hour converting my site from adaptive to responsive. Here is the step by step process:
How to make your site fully responsive
1. Flexible typesetting
Change all type sizes to ems.
Assuming you want your base font size to be 16px (context), which is typically the browser default, the body font-size is therefore 100%. All other font sizes are then relative to this font size using ems.
target/context = result
Therefore if we want our H1 to be 72px (target):
72(target) / 16(context) = 4.5(result)
font-size:4.5em/* 72 / 16 */;2. Flexible grid
Change column widths to percentages (or ems) rather than pixels.
Give your container a max-width. This will be the bounding box for your grid. Everything within the box is then relative to the max width, or the width of the browser (if less than the max width).
1140 CSS Grid is a useful boilerplate with a flexible responsive grid.
3. Flexible images
Give all images a max-width of 100%. This will ensure they don’t ‘break’ your design.
img{max-width:100%};4. Box-sizing
One issue I’ve always had with fluid grids is making input field widths flush with the grid. You want a textarea to be 100% width of the parent div, but you also want it to have a 2px border and 5px padding. Thanks to box-sizing:border-box we have a solution.
textarea{padding:5px;border:2px solid #ddd;width:100%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;5. Additional hacks
There may be additional hacks like positioning and width issues you have to think about. In my case, the jQuery slider plugin I was using on the homepage needed a fixed width.
Thankfully, Jordan Burke was able to recommend FlexSlider, a fully responsive jQuery slider plugin.
Further reading
- 1140 CSS Grid – A fully responsive CSS boilerplate
- The Goldilocks Approach to Responsive Web Design – Nice article and boilerplate from Front, focused on responsive design from the content out
- MQFramework – A useful responsive CSS framework
Related articles
9 Appreciated Comments
Have a comment? Tweet @leemunroe and I'll be glad to respond.

On the , Wayne McManus said:
Good read, with some useful pointers.
About to ‘responsify’ my site and this will come in handy. Keep up the good work!
On the , bus rental said:
this is really informative. thanks.
On the , Lee Gustin said:
Great article Lee :) Thanks for the link to the 1140 grid, I have been considering doing fully responsive and that grid system looks pretty solid.
cheers
On the , Zap! Media said:
Great article, thanks for sharing. A few of our clients have already noticed a need for Responsive Web Design. In our opinion, this will be a BIG trend for web design in 2012.
On the , Andrea Ballerino said:
Great article! Thanks.
On the , Tony Bianco said:
Fantastic article on responsive design. The MQFramework was a great find, well worth the article. Would be cool if there was a Boilerplate/MQFramework implementation. Although in our designs instead of using the 960 grid we typically use the 978px grid. However with most desktops using large monitors why not use 1140px!
On the , Jesus Bejarano said:
Excellent article keep going for more
On the , Sara said:
Great Information sharing, my site is not responsive in less than 1280 resolutions, it really helps to implement as responsive
On the , René said:
It’s a great article to read!
However, i’ve got a question.
With these tips given, a site is fully responsive you say.
But you’ll always keep a @media query to style mobile sites, isn’t it?
You use it yourself with this site I saw in the source code.
Am I missing the point at your first statement that sites should be flexible? Or am I wrong?