This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

Responsive web design is a technique which essentially uses Cascading Style Sheets 3(CSS3 media queries with fluid proportion-based grids, to adapt the layout of the website to the viewing environment (that is, the device it is viewed in) and minimize user adjustments of resizing or scrolling.

The term Responsive Web Design was originally coined by Ethan Marcotte in an article on A List Apart in the year 2010(A List Apart). In his words, "Responsive design is not a single piece of technology, but rather a set of techniques and ideas that form a whole."

1. Need of a Responsive Website

Mobile phones will overtake PCs as the most common Web access devices worldwide by 2013, according to a forecast by research firm Gartner (2013 Gartner Tablet Forecasts). For the first time since 2001, in 2012 PC sales were projected to be lower than they were in the previous year. Before responsive design came in, the solution was to create a mobile version of your site, but the solution is useless when you have a large number of available screen sizes - you cannot keep creating a website version to accommodate each of the devices.

To make a website consistent across all devices, it is better to have a single responsive stylesheet than having its separate mobile and desktop versions. Not only does it help to keep costs down, but it also ensures that the websites are and will be compatible with the recent and future trends.

2013 is being dubbed as the year of responsive web design (Why 2013 Is the Year of Responsive Web Design). Responsive designs solve the problem of making a website work for the endless number of new devices and resolutions being used to access the web. In words of Jody Resnick, CEO of Trighton Interactive (Jody Resnick) - “With a responsive website, businesses can be in front of consumers at every step of their online journey. People who search for a business’ site, begin reading content and viewing videos from their desktop computers at work, and then look for the same business on their smartphones during lunch are able to continue their research into products and services uninterrupted."

“In contrast, if the business has a traditional website and a mobile site, someone investigating products and services online can become frustrated by the lack of complete content on the mobile site or the inability to navigate through the full site on her smartphone. She might give up the search altogether,” Resnick warns.

“Responsive websites provide continuity between different viewing contexts, remaining completely agnostic to the type of device used and the size of the screen it has. What this means is that the same website will present an optimized layout regardless of which device it finds itself being loaded in.” Responsive websites simplify internet marketing and SEO. Instead of having to develop and manage content for multiple websites, businesses with responsive sites can take a unified approach to content management because they have only the one responsive site to manage. The same applies to analytics and strategy development and deployment. A responsive website means there is only one set of analytics to examine and a single strategy to develop and deploy. “In addition, responsive websites are easier for consumers to find than traditional or mobile sites because they come up higher in search engines’ rankings,” explains Resnick. “In fact, Google recommends responsive web design because having a single URL for desktop and mobile sites makes it easier for Google to discover content and for Google’s algorithms to assign indexing properties to content.”

2. Framework and Technologies

2.1. CSS3 media queries

CSS Media Queries are a feature in CSS3 which allow you to specify when certain CSS rules should be applied. This allows you to apply a special CSS for mobile, or adjust a layout for print. Style sheets with media queries attached to their <link> tags will still download even if their media queries would return false (they will not apply, however). (Media Queries)

Example : Creating responsive text with media query. Create a html file

<html>
<head>
        <link rel='stylesheet'  href='normal.css' />
        <link rel='stylesheet' media='screen and (min-width: 1400px)' href='big.css' />
        <link rel='stylesheet' media='handheld' href='mobile.css' />
</head>
<body>

        <h1 id="responsive"> This is responsive text </h1>
        <h1 id="res2"> Another responsive </h1>
        <p id="handheld"> this is a mobile text <p>
</body>

</html>

And css files to support it: normal.css

@media screen{
        #handheld{
                display:none;
        }
}

@media screen {
        #responsive {
                font-size:60px
  }
}

@media screen and (min-width:500px) and  (max-width: 900px) {
        #responsive{
                color : red;
        }
}
@media screen and (min-width:700px) and  (max-width:1000px){
        #responsive{
                font-family:arial;
        }
}

@media handheld {
        #responsive {
                font-size:20px
        }
}

big.css

#res2{
        font-size:80px;
}

mobile.css

#handheld{
        display:block;
}

Now, you can open your html page in a browser and try resizing the browser for trivial testing. You can see the responsive page working. Further, you can test it in handheld media to check the responsiveness.

Media queries can do more than just define different font sizes. Often, you will actually move entire sections of the page depending on the available screen size. For example, using a three-column layout might look good on a laptop screen, but it won't work on a small device like a smartphone. In this case, you might want to move one or more columns or elements on the page to adjust to the available space

2.2. Frameworks

Using an existing framework reduces the initial work as they promote grid based design and deal with cross browser compatibility issues. Such frameworks cover all bases and you do not need to start from scratch. It ensures you have the responsive grids setup in a standard and best practice fashion, which saves your time for coding and testing. It further allows you to focus on the specific design and content needs for the website.

The trend now seems to be either creating custom fit for purpose responsive layouts or using Twitter Bootstrap Some of its features include:

Helium is a frontend responsive web framework for rapid prototyping and production-ready development using HTML5 and CSS3. In many ways it is similar to both Twitter Bootstrap and ZURB Foundation but is designed to be much more lightweight and easier to play with.

Other available frameworks are:

2.3. Additional Libraries

These libraries can enhance the look and feel of your responsive website.

Deciding the type of responsive layout according to site's existing content and its presentation is the initial step towards building a responsive design. Multi-Device Layout Patterns

The ultimate key is to keep it simple, in the early stages of Responsive website development - making only fluid text and images and once the basic design is done, find the specific points where you can improve the media queries and implement the advance options.

3. Testing Responsive Design

3.1. Web developer tools

3.2. Using other Website Testing Frameworks

3.3. Using Physical Devices

One major problem in this method will be while you are still in your development stage on your localhost. One possible solution could be making an Ad hoc-connection from your laptop/PC and connecting the various physical devices(phone or tablet) to that network.

4. Responsive Design Implemented

5. Challenges

With responsive design the HTML is the same for every visiting device and each time a page loads on mobile. It also loads all of the HTML elements including images & scripts intended for the tablet and desktop sites. Every time a user visits your site they download the full page content by default – no matter which device they are using. The kind of CSS we use should ensure that the information which is more relevant should be more easily accessible to the user.

Planning well in advance and establishing a good content hierarchy and CSS optimization with tools like Sass can help.Responsive Design Tips

7. Responsive Gnome

8. References


2024-10-23 11:10