2. Responsive Web Design: Definition
A responsive design is composed of three
distinct parts:
• Flexible grids
• Flexible media (images and video)
• Media queries
Making sites device agnostic
3.
4. Flexible Grids
Flexible grids expand and contract to fit the
context in which they are viewed
• Use formula:
target / context = result
• Example
900 / 960 = 0.9375
• Think in pixels percentages
6. Flexible Media
Add constraints to prevent images
overflowing their containers
• Technique:
img {
max-width: 100%;
height: auto;
}
• Internet Explorer 6 or below:
img {
width: 100%;
}
7. Flexible Media (cont...)
•
UseTechnique: instead of scaling
of overflow,
.container {
overflow: hidden;
}
img {
max-width: auto;
}
• Also applies to <video />, <embed />
and <object />
8. Media Queries
“A robust mechanism for identifying not
only types of media, but inspection of
physical characteristics of the devices”
• Example:
@media screen and (min-width: 1024px) {
body {
font-size: 100%;
}
}
<link href=”desktop.css” rel=”stylesheet” media=”screen and (min-width:
1024px)” />