Responsive Design: A Crash Course and Demo

Similar documents
Principles of Web Design 6 th Edition. Chapter 12 Responsive Web Design

Responsive Web Design in Application Express

Viewports. Peter-Paul Koch jquery EU, 28 February 2014

Going Beyond SAP ITS Mobile Apps to a Responsive Design Mobile Apps. JK (JayaKumar Pedapudi) Principal Consultant NTT DATA, Inc.

Responsive Web Design. birds of feather

Responsive Design Best Practices

Mobile Optimise your s. Code & examples to make your campaigns mobile friendly

This document will describe how you can create your own, fully responsive. drag and drop template to use in the creator.

Recommendations for Websites Optimization for Mobile Devices Using Mobile Centric CSS. February 2014 Update

White Paper Using PHP Site Assistant to create sites for mobile devices

Building Responsive Layouts

Responsive Web Design (RWD) Best Practices Guide Version:

Table of Contents. What is ProSite? What is Behance? How do ProSite & Behance work together? Get Started in 6 Easy Steps.

Adding image galleries inside your Joomla! articles has never been easier!

RESPONSIVE DESIGN FOR MOBILE RENDERING

MAKING YOUR SITE MOBILE-FRIENDLY INCLUDES STEPS FOR GOOGLE MOBILE SEARCH COMPLIANCE

Responsive and Adaptive Web Design. Responsive & Adaptive websites-respond to the user s device by showing an optimized view.

Responsive Web Design for Teachers. Exercise: Building a Responsive Page with the Fluid Grid Layout Feature

THE SAS OUTPUT DELIVERY SYSTEM: BOLDLY TAKE YOUR WEB PAGES WHERE THEY HAVE NEVER GONE BEFORE! CHEVELL PARKER, SAS INSTITUTE INC.

GUIDE TO CODE KILLER RESPONSIVE S

Welcome to the Shortlist story map application template

Magento Responsive Theme Design

Creating a social networking website with mobile accessibility. A Guide to WordPress, BuddyPress, and mobile readiness

Responsive Web Design for Drupal

WP Popup Magic User Guide

SellerDeck 2014 Responsive Design Guide

Kentico CMS, 2011 Kentico Software. Contents. Mobile Development using Kentico CMS 6 2 Exploring the Mobile Environment 1

Sizmek Formats. IAB Mobile Pull. Build Guide

RESPONSIVE DESIGN BY COMMUNIGATOR

Level 1 - Clients and Markup

Deep analysis of a modern web site

You can use percentages for both page elements and text. Ems are used for text,

Building Responsive Websites with the Bootstrap 3 Framework

Responsive Web Design: Is It Worth It?

Creating Web Pages with Microsoft FrontPage

WP Popup Magic User Guide

Aspect WordPress Theme

1. About the Denver LAMP meetup group. 2. The purpose of Denver LAMP meetups. 3. Volunteers needed for several positions

CREATING RESPONSIVE UI FOR WEB STORE USING CSS

Responsive Design How to get started

Responsive Web Design: Media Types/Media Queries/Fluid Images

Let's Dig Into the Omega Theme October 27,

Treble: One Page Website. Step 8 - Responsive Web Design

Startup Guide. Version 2.3.9

RESPONSIVE WEB DESIGN

Please select one of the topics below.

Create a Google Site in DonsApp

Quick Start Guide Mobile Entrée 4

How To Change Your Site On Drupal Cloud On A Pcode On A Microsoft Powerstone On A Macbook Or Ipad (For Free) On A Freebie (For A Free Download) On An Ipad Or Ipa (For

WordPress websites themes and configuration user s guide v. 1.6

1. Tutorial - Developing websites with Kentico Using the Kentico interface Managing content - The basics

Responsive Design for

USER S MANUAL JOOMLA! GOVERNMENT WEB TEMPLATE

Responsive Web Design. vs. Mobile Web App: What s Best for Your Enterprise? A WhitePaper by RapidValue Solutions

Piktochart 101 Create your first infographic in 15 minutes

MAGENTO THEME SHOE STORE

DESIGNING MOBILE FRIENDLY S

RESPONSIVE DESIGN

!!!!!!!! Startup Guide. Version 2.7

<Insert Picture Here>

Recreate your Newsletter Content and Layout within Informz (Workshop) Monica Capogna and Dan Reade. Exercise: Creating two types of Story Layouts

Airangel s WiFi Portal Best Practice Guidelines Get the most out of your WiFi infrastructure

Configuring the JEvents Component

SellerDeck 2013 Reviewer's Guide

NDSU Technology Learning & Media Center. Introduction to Google Sites

ireview Template Manual

Responsive Web Design (RWD) Building a single web site for the desktop, tablet and smartphone

2011 ithemes Media LLC. All rights reserved in all media. May be shared with copyright and credit left intact

UCL INFORMATION SERVICES DIVISION INFORMATION SYSTEMS. Silva. Introduction to Silva. Document No. IS-130

Making Content Editable. Create re-usable templates with total control over the sections you can (and more importantly can't) change.

Develop IBM i Mobile and Desktop Applications with a Single Code Base. BCD Software, LLC. All rights reserved.

Chapter 8 More on Links, Layout, and Mobile Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

Microsoft Expression Web

Responsive Design Guide. The fundamentals of designing and building mobile optimized

HTML5 Standard Banner

Web Browser. Fetches/displays documents from web servers. Mosaic 1993

Using HTML5 Pack for ADOBE ILLUSTRATOR CS5

Getting Started with WebSite Tonight

Sage CRM. Sage CRM 2016 R1 Mobile Guide

SmallBiz Dynamic Theme User Guide

Responsible Web Design A Pragmatic Approach to Website Design for Multiple Devices

Designing for Mobile Devices

When you create your own web site you will need to get or claim your worldwide address also known as a domain name.

Making Textual Webpage Content Responsive

JTouch Mobile Extension for Joomla! User Guide

Written by: Doug Schust, WSI Digital Marketing Expert

Mobile Strategy and Design

A set-up guide and general information to help you get the most out of your new theme.

History Explorer. View and Export Logged Print Job Information WHITE PAPER

01/42. Lecture notes. html and css

HOW Interactive Design Conference 2013

Adding Images to Broadcast s - 1

ON24 MOBILE WEBCASTING USER GUIDE AND FAQ FEBRUARY 2015

Designing for the Mobile Web Lesson 3: HTML5 Web Apps

Responsive Design. Our guide to helping you get started. March 2013 Version 0.4

Coding HTML Tips, Tricks and Best Practices

Microsoft Expression Web Quickstart Guide

MS Word 2007 practical notes

Luxriot Broadcast Server Manual

SEO Toolkit Magento Extension User Guide Official extension page: SEO Toolkit

Transcription:

Responsive Design: A Crash Course and Demo Using some styling techniques, you can add responsive design to a WordPress theme or standard HTML and CSS website. Responsive design is a new trend in web development that perhaps seems complex but it's actually quite straightforward once you master some basic CSS rules. What is Responsive Web Design? With more and more website and blog visitors browsing the web from smartphones and tablets, web designers need to adapt to this by creating websites that are optimized for mobile browsers. The standard way of designing mobile websites has traditionally been to create different versions of your website for tablets and smartphones, meaning that you may create a standard website that is intended for desktop computer viewing, a tablet website that is optimized for devices like the ipad and Android tablets, and a smartphone microsite that is optimized for devices like the iphone and Nexus smartphones, etc. With the newer trend of responsive web design, however, a web designer can simply tweak the existing website using just CSS (adding, removing and modifying elements along the way), to create different versions of a website or blog without changing the content. Accordingly, many web designers use responsive design to create different website views for desktops, smartphones and tablets. Do You Need It? While implementing responsive web design is not mandatory from a functionality standpoint, it is a great option to add to an existing website or blog for the convenience of your site visitors and members. You've probably used a smartphone before to browse a website that featured only a normal, desktop view. In doing so, you may have noticed that browsing through the site wasn't the easiest it required a lot of zooming in, scrolling, etc. The reality is that mobile web browsing is exploding. With more and more users coming to your site from mobile devices, it's important to consider accommodating them. With responsive web design, you can use standard CSS rules to create a mobile-targeted version of your website that provides an enhanced user experience for these visitors. The Basic Code You can easily get started on creating your responsive design by adding some basic rules to the CSS stylesheet for your WordPress blog or standard HTML website. First, though, you must add a viewport meta tag to the <head> section of your HTML page or WordPress theme's header template. This tells mobile browsers to display the page at full size instead of scaling it: <meta name="viewport" content="width=device-width, initial-scale=1.0" /> By telling these smaller devices not to scale the content, it means we have fewer pixels to work with.

Our next step is to add the CSS code that controls the display in these small-screen situations. This is where special @media only screen code comes in, which needs to be added to your CSS stylesheet. Here is an example: /* -----------Smartphone View----------- */ @media only screen and (max-width : 480px) { /* All your smartphone rules go inside here */ Here, we've commented the CSS to label the Smartphone View because it will incorporate the code needed to optimize our site for smartphones. We've also used the @media only screen function to define the max-width (maximum width) as 480 pixels. This means that whenever a web browser window or device screen has a width of 480px or lower, it will automatically apply the contained rules, switching the layout to "smartphone view." Now, we can add some rules within this query to start making our website responsive. Let's use a WordPress theme as a guide. Here is the unmodified default theme from older versions of WordPress, pictured in a browser window that is sized below 480px:

Notice how the theme in unresponsive instead, we're left with the dreaded horizontal scrollbar. Here is the view from the iphone's Mobile Safari browser: Because we added the viewport meta tag, the page hasn't been scaled down as usual. Instead, it has been cut off, requiring scrolling for it to be read. To address this, let's add some basic display and width definitions to the starter template code: /* -----------Smartphone View----------- */ @media only screen and (max-width : 480px) { #sidebar { display: none; #content { width: 300px; #header { display: none; We hide the sidebar and header, and set an explicit width for the content area.

Here is the effect of adding just the three lines of code featured above, from a narrow web browser view: Similarly, here are the updated results on the iphone:

Notice how the view is now much simpler and optimized for a smartphone's small screen. With these simple changes, we've added entry-level responsiveness to our site! That's how easy it is to get started with responsive design. To take it to the next level, you simply need to apply more styles and CSS rules to the Smartphone View CSS. For example, you could now add a new header image, specifically designed for a small smartphone view. Tablet View By adding another similar section to your site's CSS files, we can add a tablet-optimized view as well. Here is an example: /* -----------Tablet View----------- */ @media only screen and (max-width : 650px) and (min-width : 481px) { /* All your tablet rules go inside here */ By defining the max-width as 650px and the min-width as 481px, the smartphone view we created earlier will be used when the screen (or browser window) is 480 pixels or less in width; however, once we move up to 481px to 650px, the CSS rules contained in this second query will automatically be applied instead. These rules make up our tablet view. Just as with the smartphone view, the precise CSS you use depends on your layout and design tastes. Priority of Views Note that it's important to specify smartphone- and tablet-specific CSS at the end of your stylesheet. By doing this, we ensure that our special rules override the default rules. Update: As ultrageoff mentioned in the comments, there is an exception to this rule. When you are specifying large background images in CSS for the standard view for your site, you should create a separate @media only screen section that targets only large screen sizes. Place the background-image declarations within that special section. Otherwise, devices with small screens will try to start loading those large images, negatively impacting loading performance. Because IE versions 8 and older don't support media queries, you should also place these background declarations in a separate IE-specific stylesheet for your page. Experiment! Ready to dive in and experiment with some real code? I've created a demo page that incorporates these CSS techniques in a real-life way: 1. http://jsbin.com/agejoj/2 2. First, load the page in a maximized web browser window. 3. Resize the window horizontally, and see how the page transforms itself. Note: Because this is just a demo, IE8 only shows the full desktop view (it won't automatically transform as it's resized). Adding support for IE8 requires some extra workaround code, as the browser doesn't natively support media queries.

Next, load the page on your mobile device: Whether you're using a phone or a tablet, you should automatically see a layout that's optimized for your device. You can see the source code and experiment here: http://jsbin.com/agejoj/2/edit (Click the little HTML and CSS buttons on the bar at the top of the window to view the code; click Output to toggle the preview). Conclusion By using responsive design, you can quickly and easily optimize your website or blog for mobile viewing. The simple addition of media queries allows you to apply certain CSS rules to optimize the site for small-screen browsing.