Professional Documents
Culture Documents
Lecture 4 - Responsive Web Design
Lecture 4 - Responsive Web Design
Lecture 4 - Responsive Web Design
Responsive Web Design (RWD)
Responsive Web design is the approach that suggests that design and development should respond to the user’s behavior
and environment based on screen size, platform and orientation using the combination of flexible grids, flexible images and
media queries.
I. Overview
A site designed with RWD adapts the layout to the viewing environment by
using fluid, proportion-based grids, flexible images and CSS3 media queries,
an extension of the @media rule, in the following ways:
The fluid grid concept calls for page element sizing to be in relative
units like percentages, rather than absolute units like pixels or
points.
Flexible images are also sized in relative units, so as to prevent them
from displaying outside their containing element.
Media queries allow the page to use different CSS style rules based on characteristics of the device the site is
being displayed on, most commonly the width of the browser.
Pros
Only have to maintain a single website
Don't need to deal with mobile-specific URLs
Addresses a wide multitude of devices: phones, tablets, desktops, etc.
Cons
More difficult to optimize properly for specific devices (for example, phones might get desktop-sized images)
A. Media Queries
Media query is a CSS technique introduced in CSS3. It uses the @media rule to include a block of CSS properties only if a
certain condition is true. It enables to switch stylesheets based on width and height of viewport to have the same content,
new view depending on device.
Use a specific styles on different devices
@media screen and (max‐devicewidth: 480px) {
1
Lecture – Responsive Web Design I
… mobile styles here…
}
B. Fluid Grid
A fluid is a substance that continually deforms (flows) under an applied shear stress.
In fluid grids there is a defined maximum layout size for the design. The grid is divided into a specific number of columns
to keep the layout clean and easy to handle. So whenever the device or screen size is changed, elements will adjust their
widths and heights by the specified proportions to its parent container.
2