Skip to main content

Techniques in responsive web design

 

We’ve talked a lot about responsive design here on Webdesigner Depot, and shared a lot of valuable resources. Today we’re sharing another valuable resource: at the end of this article are details for getting a discount on Chris Converse’s responsive design course on MightyDeals.

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 CSS for compatibility older browsers.

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 your design loads on smaller screens, and gives you the opportunity to customize each version of your graphic.

The example below 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.

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 . 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 it’s background using CSS.

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 all the 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 is 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.

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 by setting absolute positioning properties on the navigation container when viewed on larger screens, and removing the position properties on small 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 the 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.

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.

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 for browsers that support CSS-based layouts, but not CSS3 media queries.

Learn to create a responsive web design

Follow along with Chris Converse as he teaches you to create the above web design step-by-step. The regular price for the Creating Responsive Web Design course is $150, but for a limited time you can get the course via Mighty Deals for only $39!

Chris Converse is a designer, photographer, and web developer at Cōdify Design Studio. Chris is a regular featured speaker at Adobe MAX, HOW Design and Interactive Conferences, AIGA, and Mogo Media events. Find his video workbooks Bring Your Web Design to Life and Creating Interactive Documents on your favorite bookstore’s website, follow him on Twitter and Facebook.

Source

Techniques in responsive web design
Cameron
Thu, 24 Nov 2011 09:01:36 GMT

Popular posts from this blog

Apple Launches Web Tool to Deregister Phone Numbers from iMessage

Apple today released a new web tool for users to deregister their phone number from iMessage in the event they switched to a non-Apple device. To deregister a phone number from iMessage, users simply enter their phone number in Apple's web tool, receive a free text message containing a code, and submit the code to complete the process. Users who still have their original iPhone can also transfer their SIM card back to the device and go to Settings -> Messages to turn iMessage off. 


Users switching from an iPhone to another device were often unable to receive SMS messages from another iPhone due to their phone number still being linked to iMessage. These specific errors with iMessage have been a well-known issue since 2011, which is when the messaging service debuted with iOS 5. They were also made even more apparent this past May, where a server glitch caused widespread message delivery problems. Apple was even sued over the matter in a California court, although the company cla…

Microsoft acquires iPhone email app Acompli

After accidentally announcing it a little early, Microsoft is officially confirming it has acquired email startup Acompli. The surprise acquisition means Microsoft is picking up a powerful email client for iPhone and Android in another move that further cements CEO Satya Nadella’s focus on cross-platform technologies. The Verge’s Casey Newton called Acompl "the Outlook for iPhone that Microsoft hasn’t yet built," and it seems Microsoft was equally impressed with the powerhouse email app. "We’re excited about what’s possible as we build on the app’s success and bring it together with work currently in progress by the Outlook team," the company said in a statement. "Our goal is to deliver fantastic cross-platform apps that support the variety of email services people use today and help them accomplish more." Recode first reportedthat Microsoft would make its latest acquisition official today; the company is said to be paying over $200 million for Acompli. A…

iOS 10.3.2 now available to download on iPhone and iPad

Nearly a month and a half after iOS 10.3.1 rolled out to the public, Apple has now officially released iOS 10.3.2 on iPhone, iPad and iPod touch. We're still waiting on detailed release notes from Apple, but the update screen reveals that the new version of iOS focuses on bug fixes and security improvements.
Continue reading...
Trending right now:
WannaCry: Everything you need to know about the global ransomware attackTim Cook's refusal to help FBI hack iPhone is validated by 'WannaCry' ransomware attackNetflix is testing a price hike that would be pure evil

http://bgr.com/2017/05/15/iphone-ipad-update-ios-10-3-2-download-install/