Two columns with header and footer : Two columns « Layout « HTML / CSS






Two columns with header and footer

   

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
    <head>
        <title>Multi-column Layout</title>
        <style rel='stylesheet' type='text/css'>
div#heading,
div#container,
div#footer {
    border: 1px solid black;
    max-width: 1000px;
    min-width: 600px;
}
div#container {
    position: relative;
    margin: 0 auto;
}
div#heading {
    margin: 10px auto -1px auto;
}
div#heading h1 {
    margin: 5px;
}
div#left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 200px;
    background: #ccc;
    padding: 5px;
    border-right: 1px solid black;
}
div#content {
    margin-left: 211px;
    background: white;
    border: 1px solid white;
    padding: 10px;
}
div#footer {
    margin: -1px auto 10px auto;
}
div#footer p {
    margin: 5px;
}        
        </style>
    </head>
    <body>
        <div id='heading'>
            <h1>Heading</h1>
        </div>
        <div id='container'>
            <div id='left'>
                Left side column.
            </div>
            <div id='content'>
                <h4>Lorem Ipsum</h4>
                <p>
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec eu
                </p>
                <p>
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec eu
                </p>
            </div>
        </div>
        <div id='footer'>
            <p>
                    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec eu
            </p>
        </div>
    </body>
</html>

   
    
  








Related examples in the same category

1.2 column with left content floats left
2.Two columns with a footer
3.Head and footer with two columns in between
4.Header bar, two columns, menu on the right
5.2-column Layout with total width 922px, and float right
6.2-column with total width 922 px and left column 678 px, float right
7.2-column with total width 922px, left width 200px, float right
8.2-column layout with margin in between
9.2-column, with float left and right, left 678px width
10.2-column with relative positioned right column
11.Two column: content and right bar
12.Two column with negative margin
13.Floated Two Column Layout
14.Two columns with separator
15.Two columns with background
16.Two columns with width: 50%
17.Two columns with header banner
18.Two row layout: one floats left, one floats right
19.Header and sub header with two columns and footer
20.float left and right with other content
21.Two columns
22.Master header and two columns
23.Floated Two-Column Layout 2
24.Header and two-column layout
25.Two Column Layout in HTML with table
26.Two Columns Layout Using CSS
27.Two column layout with red theme
28.Two column layout template to illustrate all
29.Two column layout to illustrate all
30.Two column layout template 2
31.Two column layout template 3
32.Two column with text header
33.Two-column with sidebar layout
34.Two-column layout with header and footer
35.Two even columns