Css Layouts
Css Layouts
Header
A header is usually located at the top of the website (or right below a top navigation menu).
It often contains a logo or the website name
Navigation Bar
A navigation bar contains a list of links to help visitors navigating through
your website:
Content
The layout in this section, often depends on the target users. The most
common layout is one (or combining them) of the following:
Unequal Columns
The main content is the biggest and the most important part of your site.
Footer
The footer is placed at the bottom of your page. It often contains information
like copyright and contact info:
Example : Pgm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
*{
box-sizing: border-box;
body {
margin: 0;
.header {
background-color: #f1f1f1;
padding: 20px;
text-align: center;
.topnav {
overflow: hidden;
background-color: #333;
.topnav a {
float: left;
display: block;
color: #f2f2f2;
text-align: center;
text-decoration: none;
.topnav a:hover {
background-color: #ddd;
color: black;
.column {
float: left;
padding: 10px;
}
/* Left and right column */
.column.side {
width: 25%;
/* Middle column */
.column.middle {
width: 50%;
.row::after {
content: "";
display: table;
clear: both;
/* Responsive layout - makes the three columns stack on top of each other instead of next to each
other */
.column.side, .column.middle {
width: 100%;
.footer {
background-color: #f1f1f1;
padding: 10px;
text-align: center;
</style>
</head>
<body>
<div class="header">
<h1>Header</h1>
</div>
<div class="topnav">
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#">Link</a>
</div>
<div class="row">
<h2>Side</h2>
</div>
<h2>Main Content</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna.
Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique. Quisque vehicula,
risus eget aliquam placerat, purus leo tincidunt eros, eget luctus quam orci in velit. Praesent
scelerisque tortor sed accumsan convallis.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sit amet pretium urna.
Vivamus venenatis velit nec neque ultricies, eget elementum magna tristique. Quisque vehicula,
risus eget aliquam placerat, purus leo tincidunt eros, eget luctus quam orci in velit. Praesent
scelerisque tortor sed accumsan convallis.</p>
</div>
<h2>Side</h2>
</div>
</div>
<div class="footer">
<p>Footer</p>
</div>
</body>
</html>.