Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Creative tools for business
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / HTML5, CSS3, and JavaScript /

Udemy excerpt: Techniques in responsive web design

by Chris Converse

Chris Converse
  • Codify Design Studio

Content

  • Adding imagery with CSS
  • Reposition the global navigation on hand-held devices
  • Use large screen CSS as default for older browsers
  • Where to go from here

Created

30 April 2012

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print

Requirements

Prerequisite knowledge

Before you begin, note that this article is a partial look at a larger tutorial on udemy.com.

 

Chris Converse is offering the Adobe Developer Community readers a 67% discount on the full Udemy.com course Creating Responsive Web Design. Use the coupon code at the bottom of this article.

User level

All

Sample files

  • udemy-excerpt-design-psds.zip

CSS3 media queries allow us to dynamically alter the design and layout of a web page in order to deliver an optimal user experience from a single set of HTML and CSS markup. The techniques in this article explain how we can leverage this powerful capability of CSS to also change imagery, alter the navigation on hand-held devices, and set up default CSSS for compatibility older browsers. Watch the video below to learn more.

fig01 Video: Introduction to multiscreen web design

Figure 1. Optimize user experience from a single set of HTML and CSS markup.

Adding imagery with CSS

Creating different images

When altering your design for different devices, consider creating multiple versions of your graphics. This can greatly affect the speed at which you design loads on smaller screens, and gives you the opportunity to customize each version your graphic. Watch the video below to learn more.

fig02 Video: Slicing and optimizing graphics

Figure 2. Create multiple versions of your graphics.

The example above shows the different sizing, and cropping choices, in addition to the varying amounts of compression that are applied to each set of images. Since many small screen devices have higher resolution screens, the extra compression is unnoticeable, and the file size is significantly smaller.

Download the source Photoshop files and follow along. Take advantage of the fact you can switch your images dynamically, and customize the sizing and cropping of your images for each screen size. In the example above, the sidebar photo for the large screen size shows more detail of the stained glass window, whereas the smaller images show more context of the window.

Assign images to HTML elements

Images are typically added to a web page using the image tag <img>. While we can use media queries to alter the sizing of the images, we cannot change the actual graphic file being used. Instead of using the image tag, we can use an HTML element as a container, such as div tag, and assign an image into its background using CSS. Watch the video below to learn more.

fig03 Video: Adding imagery with CSS

Figure 3. Change actual graphic with an HTML element as a container.

Assigning images to an element's background allows us to change the referenced graphic file, in addition to being able to alter the dimensions and position properties of the container.

Reposition the global navigation on hand-held devices

When viewing web pages on larger screens, the expected location of the navigation is at the top, or left side, of the screen. Considering larger screens allow us to see content in addition to the navigation, this user experience does not hinder the user from getting the content. On hand-held devices, however, the navigation can take up the entire screen real estate if it appears at the top. This can also lead the user to believe they must make another navigation choice instead of realizing the content further below on the page.

For hand-held devices, global navigation typically appears after the content, so a user can swipe upward through the content, then be presented with additional navigation options. The challenge here is to reposition the navigation with CSS without needing to alter the HTML. Watch the video below to learn more.

fig04 Video: CSS rules for small screens

Figure 4. Navigation markup is placed after the main content markup.

The figure above shows that the navigation markup is placed after the main content markup. This allows us to keep the natural flow of content for hand-held devices, and reposition the navigation on larger screens. This is achieved my setting absolute positioning properties on the navigation container when viewed on larger screens, and removing the position properties on small screens.

Figure 5. Navigation is repositioned on smaller screens.
Figure 5. Navigation is repositioned on smaller screens.

In addition to changing the position of the navigation, we can also change the style as well. Standard anchor tags are restyled on small screens to reflect to look of mobile buttons commonly used on hand-held devices. The figure below shows the dramatic transformation our CSS file can have on our navigation links.

Figure 6. CSS file can have a dramatic transformation on our navigation links.
Figure 6. CSS file can have a dramatic transformation on our navigation links.

Use large screen CSS as default for older browsers

In order to keep backwards compatibility with older browsers, keep the large screen rules outside of any media queries. This will ensure earlier versions of browsers that lack support for media queries can still "see" a set of CSS rules.

Figure 7. For backward compatibility, keep the large screen rules outside of any media queries.
Figure 7. For backward compatibility, keep the large screen rules outside of any media queries.

When the media query conditions are met by your user's screen size, the rules defined within the query will override the rules outside of any queries for large screen devices. This will give you some built-in backwards compatibility to browsers that support CSS-based layouts, but not CSS3 media queries.

Where to go from here

Follow along with Chris Converse as he teaches you to create the above web design step-by-step. Chris is offering the Adobe Developer Community readers a 67% discount on his Udemy.com course Creating Responsive Web Design. Use the coupon code adobe-devnet to take this course for only $49. This course includes all HTML and CSS markup, graphic files, as well as pre-sliced Photoshop files to help get started in creating and customizing your own responsive web designs.

fig08

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement