Google News
logo
CSS Layout
CSS layout is easy to design. We can use CSS layout to design our web page such as home page, contact us, about us etc.

There are 3 ways to design layout of a web page:

1. HTML Div with CSS:  Fast and widely used now.
2. HTML Table:  Slow and less preferred.
3. HTML Frameset:  Deprecated now.

A CSS layout can have header, footer, left pane, right pane and body part. Let's see a simple example of CSS layout.
Basic Layout
<!DOCTYPE html>  
<html>  
<head>  
<title>Basic Layout</title>
<style>  
.header{ 
width:94%; 
margin:5px auto 0px; 
background:#F90 !important; 
color:#FFF; 
text-transform:uppercase; 
font-size:40px; 
padding:15px 0px; 
text-align:center;
 height:70px;
}  
 
.header_left{ float:left; width:20%;}
.header_right{ float:left; width:74%;}
 
.container{
width:94%; 
margin:0px 3% 0px; 
float:left; 
background:#EEE !important;
} 
 
.main_left{
width:13%;
float:left; 
padding:10px 15px;
}  
.main_center{
width:65%;
float:left;
background-color:pink;
padding:5px; 
text-align:justify; 
padding:10px 15px; 
line-height:24px;
}  
.main_right{
width:13%;
float:left; 
padding:10px 15px;
}  
 
.footer{ 
width:94%; 
margin:0px 3% 5px; 
background:#F90 !important; 
color:#FFF; 
font-size:16px; 
padding:5px 0px 15px; 
text-align:center; 
float:left; 
height:30px;
}   
 
</style>  
</head>  
<body>  
<div class="header">
<div class="header_left">
<a href="http://freetimelearning.com" target="_blank"><img src="../images/Free-Time-Learning.png" width="151" height="70"></a>
</div>
    <div class="header_right">Sample Project</div>
</div>  
  
<div class="container">  
<div class="main_left">  
<p><a href="#">Home</a></p>  
    <p><a href="#">About Us</a></p>
    <p><a href="#">Services</a></p>
    <p><a href="#">Gallery</a></p>
    <p><a href="#">Contact Us</a></p>
</div> 
 
<div class="main_center">  
<h2>What is Lorem Ipsum?</h2>  
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. 
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, 
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
 
<h2>Why do we use it?</h2>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. 
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 
when an unknown printer took a galley of type and scrambled it to make a type specimen book. 
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. 
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, 
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>  
<div class="main_right"><img src="images/sample_111.jpg" width="100%"></div>  
</div>  
  
<div class="footer">  
<p>All &copy; rights reserved by <a href="http://freetimelearning.com" target="_blank">www.freetimelearning.com</a></p>   
</div>  
  
</body>  
</html> 
Output :
Sample Project

What is Lorem Ipsum?

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, And more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Why do we use it?

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).