Here we are going to create a 3 column responsive layout. According to the size of the output screen it will adjust itself. We have to control the responsive nature of the page by media screen code of the css. It determine the active css for different size of the output screen.
<html>
<head>
<link href="3col.css" rel="stylesheet" type="text/css">
</head>
<div class="pagewrap">
<header>
<h1>3 Column Responsive Layout</h1>
</header><section class="content">
<h2>1st Content Area</h2>
<p>On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look.
</p>
</section><section class="middle">
<h2>2nd Content Area</h2>
<p>On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document. You can use these galleries to insert tables, headers, footers, lists, cover pages, and other document building blocks. When you create pictures, charts, or diagrams, they also coordinate with your current document look.
</p>
<p>You can easily change the formatting of selected text in the document text by choosing a look for the selected text from the Quick Styles gallery on the Home tab. You can also format text directly by using the other controls on the Home tab. Most controls offer a choice of using the look from the current theme or using a format that you specify directly.</p>
</section><aside class="sidebar">
<h2>3rd Content Area</h2>
<p>To change the overall look of your document, choose new Theme elements on the Page Layout tab. To change the looks available in the Quick Style gallery, use the Change Current Quick Style Set command. Both the Themes gallery and the Quick Styles gallery provclasse reset commands so that you can always restore the look of your document to the original contained in your current template.
</p>
<p>To change the overall look of your document, choose new Theme elements on the Page Layout tab. </p>
<p>To change the overall look of your document, choose new Theme elements on the Page Layout tab. </p>
</aside>
<footer>
<h4>Footer</h4>
<p>Footer text</p>
</footer></div>
</html>
body {
color: #666;
}/* STRUCTURE */
.pagewrap {
padding: 5px;
width: 960px;
margin: 20px auto;
}
header {
height: 100px;
padding: 0 15px;
background-color:#FBECBD;
}
.content {
width: 290px;
float: left;
padding: 5px 15px;
background-color:#DBC481;
}.middle {
width: 294px;
float: left;
padding: 5px 15px;
margin: 0px 5px 5px 5px;
background-color:#B4FAEA
}.sidebar {
width: 270px;
padding: 5px 15px;
float: left;
background-color:#DBC481;
}
footer {
clear: both;
padding: 0 15px;
background-color:#D5EDFA
}/* for 980px or less */
@media screen and (max-width: 980px) {
.pagewrap {
width: 94%;
}
.content {
width: 41%;
padding: 1% 4%;
}
.middle {
width: 41%;
padding: 1% 4%;
margin: 0px 0px 5px 5px;
float: right;
}
.sidebar {
clear: both;
padding: 1% 4%;
width: auto;
float: none;
}
header, footer {
padding: 1% 4%;
}
}/* for 600px or less */
@media screen and (max-width: 600px) {
.content {
width: auto;
float: none;
}
.middle {
width: auto;
float: none;
margin-left: 0px;
}
.sidebar {
width: auto;
float: none;
}
}/* for 480px or less */
@media screen and (max-width: 480px) {
header {
height: auto;
}
h1 {
font-size: 2em;
}
.sidebar {
display: none;
}}
header, .content, .middle, .sidebar {
margin-bottom: 5px;
}.pagewrap, header, .content, .middle, .sidebar, footer {
border: solid 1px #ccc;
}