This document describes the best practices for responsive web design.
This IBM guide, marked version 2013.11.20 and copyrighted 2013 by International Business Machines, collects best practices for responsive web design (RWD) when developing hybrid applications. It opens with a practitioner checklist and a list of common RWD problems, then discusses each item in a longer technical section aimed at CSS experts and web developers.
The discussion covers using CSS3 media queries instead of JavaScript orientationchange events, flexible font units (em and rem), fluid grid systems, flexible margins and padding, responsive images, media query features and the viewport meta tag, limitations of media queries, breakpoint planning, CSS Flexbox, and workarounds for complex components such as calendars, charts and grids that need a JavaScript call to resize or redraw.
The browser reflows content before onorientationchange events reach JavaScript, so positioning in JavaScript in response to those events causes multiple repaints and hurts performance.
It recommends setting the body font size to 100% so that ems can later be used to size the font.
The guide suggests using max-width of 100%, which prevents images from exceeding the width of their container, and notes it can be applied to img, embed, object and video.
It is described as a W3C Candidate Recommendation with full support in iOS 7, BB10 and IE11, while the Android browser supports the previous syntax.