To create a Responsive webpage easily

To create a Responsive webpage easily

To create a webpage responsive easily.

In this subject we go to speak on as creating a webpage responsive totally, this it does not fear very advanced, it is only a very basic example, but with this they will have a great idea on since a website becomes that is adaptable with any screen in different devices.


As creating a website responsive.

We begin.

Step 1. We define the Metatag

Within the label you must place the following lines of code.

<meta yam = " viewport? content = " width=device−width, initial−scale=1.0?/>

Internet Explorer 8 does not support average-queries, reason why we will have to give him to support by Javascript, using average-queries.js or respond.js. We will include this line in our code HTML.

<! --[if lt IE 9] > <script src= " " ></script> <! [endif]-->

Step 2. We define Structure HTML

In this example is a simple structure with header, container content, sidebar and to footer. Header is fixed and has a height of 180px. The container content has a width of 600px and the lateral bar of 300px.


Step 3. We create CSS Average.

CSS3 mediates query is the key for a design responsive. It says to him to the navigator as renderizar the page for specific widths. The following rules will be effective in a width of 980px or less. Simply the value of the width of the container of pixel changes to percentage, reason why the containers will flow, instead of being static.

/* for 980px or less */</code> #pagewrap \ {width: 94%: } #content \ {width: 65%; } to #sidebar \ {width: 30%; }

For viewport of 700px or except #content and to #sidebar passes to a width car and float is eliminated will thus have a complete width, to the 100%.

/* for 700px or less. Of car width takes control reset to the container. * #content \ {</code> width: car; float: none; } to #sidebar \ {width: car; float: none; }

For 480px or less resetea #header to car, it changes to the source h1 to 24px and hides the lateral bar.

/* for 480px or less * to #header \ {</code> height: car; } h1 \ {font-size: 24px; } to #sidebar \ {display: none; }

With this basic example, you will have some adaptable Web responsive to in different screens or a movable device.

To see demo

Abimael Gutierrez P.

Abimael Gutierrez P.
Founder of apdesc

To put a video in way background in a Webpage with HTML5 and CSS

To put a video as bottom (background) of a webpage with HTML5 being used CSS. HTML5 has become something natural for the modern navigators… To continue reading