CSS Website Layout (original) (raw)

Last Updated : 04 Jan, 2025

CSS website layout divides a webpage into multiple sections like header, navigation bar, content area, and footer, making it easier to organize content and build the site.

Structure of Website Layout

**1. Header Section

The header is the top section of a webpage, typically containing the website's name or logo.

html `

<style>
    .header {
        background-color: green;
        padding: 15px;
        text-align: center;
    }
    .header h2 {
        color: white;
        margin: 0;
    }
</style>

GeeksforGeeks

`

**In this example:

**2. Navigation Menu

The navigation menu is used to create a set of links for easy website navigation.

html `

<style>
    .nav_menu {
        overflow: hidden;
        background-color: #333;
    }
    .nav_menu a {
        float: left;
        display: block;
        color: white;
        text-align: center;
        padding: 14px 16px;
        text-decoration: none;
    }
    .nav_menu a:hover {
        background-color: white;
        color: green;
    }
</style>
Algo DS Language

`

**In this example:

**3. Content Section

The content section is used to add content to the page, and you can adjust it according to the screen size.

html `

<style>
    .columnA,
    .columnB,
    .columnC {
        text-align: center;
        color: green;
    }
</style>
Home About Contact
<div class="columnA">Content for Column A</div>
<div class="columnB">Content for Column B</div>
<div class="columnC">Content for Column C</div>

`

**In this example:

The footer section is placed at the bottom of the webpage and typically contains information like contact details, copyright, or about us.

html `

<style>
    .footer {
        background-color: green;
        padding: 15px;
        text-align: center;
    }
</style>
Upper section
About
Career
Contact Us

`

**In this example:

Important Points to Remember