This document introduces responsive design and discusses how to build websites flexibly for different screen sizes and devices. It answers common questions about responsive design, advocates flexibility over adapting to specific devices, and provides tips on content optimization, legacy browser support, responsive tools, and following a responsive design process.
42. Optimisation of background
images in CSS
‣ Use Data URIs for images to be
displayed in all sizes
‣ Use sprites
‣ Do not mix images for different screen
widths in the same sprite
50. Content Optimisation
images
‣ Use “Lazy Load” if you have many (or
large) images that only appear on
certain screen widths.
‣ Resize images on the server
54. /* Style for small screens and basic style for all */.example { ... }@media
all and (min-width: 321px) {
/* Style for a slightly wider device (like the iPhone portrait) */ .example
{ ... }
}
@media all and (min-width: 481px) {
/* Style for a even wider device (like the iPhone landscape) */
.example { ... }
}
@media all and (min-width: 769px) {
/* Style for wide screens */ .example { ... }
}
68. Priority: 1
As an increasing variety of screen and window
sizes among users is the best solution to create a
layout that is flexible and can adapt to user's
needs and wishes. Avoid making a site with fixed
layout.
— 24-hour WebCreate a design that works
regardless of window and screen size
71. Losing 80% of your screen space forces
you to focus. You need to make sure that
what stays on the screen is the most
important set of features for your
customers and your business.
72. Responsive
design
Semantically, meaningful markup
Separate design and layout
Introduce layout styles with media queries
"Mobile" CSSs + media queries = Desktop site