CSS layout

An Elegant Layout – CSS

“An Elegant Layout – CSS” is a simple CSS example of how to layout a page in a elegant manner.

DEMO LINK : http://parhammajd.co.uk/examples/css/goodLayout.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0052)http://parhammajd.co.uk/examples/css/goodLayout.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Good Layout</title>
<style>
body {
margin:0;
padding:0;
}
#header {
background-color:#000;
width:100%;
color:#fff;
}
#headercentre {
margin:0 auto;
width:1000px;
}
#navsite {
background-color:#666;
color:#fff;
width:100%;
}
#navsitecentre {
width:1000px;
margin:0 auto;
}
#container {
width:1000px;
margin:0 auto;
background-color:#ccc;
}
#footer {
background-color:#000;
width:100%;
color:#fff;
}
#footercentre {
width:1000px;
margin:0 auto;
}
.clearfloat:after {
content: ".";
display:block;
height: 0;
clear:both;
visibility:hidden;
}
/* CSS for IE6 */
*html .clearfloat {
height: 1%;
}
/* CSS for IE7 */
*:first-child+html .clearfloat {
min-height:1px;
}
#leftcolumn {
width:70%;
background-color:#06C;
float:left;
}
#rightcolumn {
width:30%;
background-color:#F00;
float:left;
}
/* Positining with Position property */
#data {
background-color:#09F;
position:relative;
height:200px;
}
#data h4 {
position:absolute;
left:0;
top:0;
margin:0;
padding:0;
}
#data img {
position:absolute;
top:0;
right:0;
padding-right:10px;
}
#data h5 {
position:absolute;
top:30px;
left:0;
margin:0;
padding:0;
}
#data p {
position:absolute;
top:150px;
left:0;
margin:0;
padding:0;
}
/* Positining with Float property */
#dataTwo {
background-color:#09F;
border:1px solid #666;
margin-top:10px;

}
#dataTwo img {
float:right;
margin-bottom:5px;
padding-right:10px;

}
#dataTwo h4 {
display:inline;
}
#dataTwo p {
clear:right;
}
</style>
</head>

<body>
<div id="header">
<div id="headercentre">
The content that goes to header <br>
The content that goes to header <br>
</div> <!-- End headercentre div -->
</div> <!-- End header div -->
<div id="navsite">
<div id="navsitecentre">
The menu goes here <br>
The menu goes here <br>
</div> <!-- End navsitecentre div -->
</div><!-- End navsite div -->
<div id="container" class="clearfloat">
The site content goes here <br>
<div id="leftcolumn">
The left coulumn content goes here<br>
<br>
<br>
<div id="data">
<h4>The title goes here</h4>
<img src="./Good Layout_files/Apps-HTML-5-Metro-icon.png" alt="html5" title="html5">
<h5>Sub title goes here</h5>
<p>The Description goes here
The Description goes here The Description goes here The Description goes here The Description goes here
</p>
</div> <!-- End data div -->
<div id="dataTwo" class="clearfloat">
<h4>The title goes here</h4>
<img src="./Good Layout_files/Apps-HTML-5-Metro-icon.png" alt="html5" title="html5">
<h5>Sub title goes here</h5>
<p>The Description goes here
The Description goes here The Description goes here The Description goes here The Description goes here
</p>
</div> <!-- End data div -->
</div> <!-- End leftcolumn div -->
<div id="rightcolumn">
The right coulumn content goes here<br>
<br>
</div><!-- End leftcolumn div -->
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</div><!-- End container div -->
<div id="footer">
<div id="footercentre">
The footer content goes here <br>
The footer content goes here <br>
</div> <!-- End footercentre div -->
</div> <!-- End footer div -->
</body></html>

Leave a Reply

Your email address will not be published. Required fields are marked *