1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en"><head><title>Two column CSS layout - header and left menu | Strictly CSS
</title>
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=iso-8859-1">
7 <meta http-equiv=
"imagetoolbar" content=
"no">
8 <link rel=
"shortcut icon" href=
"http://www.strictlycss.com/favicon.ico">
9 <script src=
"two-column-example_files/urchin.js" type=
"text/javascript"></script>
10 <script type=
"text/javascript" src=
"two-column-example_files/analytics.js"></script>
11 <script type=
"text/javascript">
14 <style type=
"text/css">
16 CSS-file for Strictly CSS three column layout 2006
17 http://www.strictlycss.com
18 Developed by Eivind Savio
20 * /*Set's border, padding and margin to 0 for all values*/
28 font-family: Verdana
, Arial
, Tahoma
, sans-serif
;
29 background-color: #eee;
30 text-align: center
; /*** Centers the design in old IE versions ***/
35 p
{padding: 7px 0 7px 0;}
42 text-decoration: none
;
61 .clear { clear: both
; }
64 margin: 0 auto
; /*** Centers the design ***/
67 text-align: left
; /*** Because we centered the text in body we have to move the text back to left aligning ***/
69 * html #mainContainer
{
70 height: 300px; /*** IE doesn't support min-height, but instead it handles height as min-height so we need to hack the height ***/
72 /**************************
74 **************************/
76 margin-top: 50px; /*** Make some space for the header menu ***/
81 /**************************
83 **************************/
88 /*** No need for hacking IE on this layout ***/
91 width: 595px; /*** This width is for non-IE browsers. Mozilla makes this necessary. Be sure to check your layout in different browsers if you changes this value. Especially IE7 seems to create a horisontal scroll if this value is set too large ***/
96 /*** div.inner is wider than its container, div.outer, and so overlaps to the right, pushing
97 div.right into the proper position. IE expands div.outer instead, requiring a Tan hack to avoid
98 blowing the layout apart. IE gets the original 100% width as in the Livingstone layout.
103 margin-left: -165px; /*** Same length as .outer padding-left but with negative value ***/
106 /*** No need for hacking IE on this layout ***/
114 position: relative
; /*** IE needs this ***/
119 .contentWrap ol, .contentWrap ul {
120 margin: 3px 0 5px 35px;
125 /**************************
127 **************************/
128 /*** div.left is in div.float-wrap, and when div.float-wrap is neg margined to the left,
129 div.left is carried over into the proper position.
139 position: relative
; /*** IE needs this or the contents won't show outside the parent container. ***/
150 /*************************
152 **************************/
154 margin: -120px 0 0 -760px; /*** Moves the right column to the top of the page. This is now our top menu above the header ***/
162 position: relative
; /*** IE needs this. ***/
163 margin-top: -125px; /***Since IE is threating padding different than other browsers we need to move it a little bit more ***/
170 display: inline
; /*** Making the links horisontal aligned ***/
173 /**************************
175 **************************/
178 margin: 0 auto
; /*** Since the footer is outside the #mainContainer we also need to center the footer ***/
180 background-color: yellow
;
182 </style></head><body>
183 <div id=
"mainContainer">
185 <h1><a href=
"http://www.strictlycss.com/" title=
"Strictly CSS - a collection of CSS sites and resources">Strictly CSS
</a></h1>
186 <h2>Two column CSS layout - header and left menu
</h2>
190 <div class=
"float-wrap">
192 <div class=
"contentWrap">
193 <h2>First in source
</h2>
194 <p>Here the three column CSS layout is transformed into a two column
195 layout with left menu and a top menu above the header. This layout
196 support
<a href=
"http://www.strictlycss.com/examples/three-column-layout-6.asp">100%
197 height with footer
</a> and
<a href=
"http://www.strictlycss.com/articles/article/22/css-faux-columns">faux
198 columns
</a> if you want to use that.
</p>
199 <p>For further information about how this two column layout with left
200 menu and a top menu above the header is made, take a look in the
202 <h3>What is this about?
</h3>
203 <p>This example page is belonging to the article
"<strong><a href="http://www.strictlycss.com/articles/article/
40/the-only-css-layout-you-need
">The
204 only CSS layout you need(?)</a></strong>". A three column CSS layout is by
205 changing mainly floating, margin and padding values (no absolute positioning is used)
206 in the CSS transformed into ten different layouts:
</p>
208 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-1.asp">Three
209 column CSS layout - left and right menu
</a>. This is the basis layout for
210 all the different layouts.
</li>
211 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-2.asp">Two
212 column CSS layout - top and left menu
</a></li>
213 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-3.asp">Two
214 column CSS layout - top and right menu
</a></li>
215 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-4.asp">Two
216 column CSS layout - left and footer menu
</a></li>
217 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-5.asp">Two
218 column CSS layout - right and footer menu
</a></li>
219 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-6.asp">Three
220 column CSS layout:
100% height with footer
</a>. This layout is also using
221 <a href=
"http://www.strictlycss.com/articles/article/22/css-faux-columns">Faux
223 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-7.asp">Three
224 column CSS fluid layout:
100% width
</a></li>
225 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-8.asp">Three
226 column CSS fluid layout:
100% width and with column borders
</a></li>
227 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-9.asp">Two
228 column CSS layout - header and left menu
</a></li>
229 <li><a href=
"http://www.strictlycss.com/examples/three-column-layout-10.asp">One
230 column CSS layout - top and footer menu
</a></li>
232 <h3>Related CSS articles and examples
</h3>
233 <p>Below are some articles that are related to these examples.
</p>
235 <li><strong><a href=
"http://www.strictlycss.com/articles/article/46/three-column-fluid-css-layout-with-rounded-content-corners-and-100-height">Three
236 column fluid CSS layout with rounded content corners and
100% height
</a></strong>.
238 <li>Example:
<a href=
"http://www.strictlycss.com/examples/three-column-rounded-corners-100-percent-height-and-width.asp">Three column fluid CSS layout:
100% height +
100% width and rounded content corners
</a></li>
241 <li><strong><a href=
"http://www.strictlycss.com/articles/article/47/css-fluid-layouts-with-faux-columns">CSS fluid layouts with faux columns
</a></strong>.
243 <li>Example:
<a href=
"http://www.strictlycss.com/examples/fluid-css-layout-with-faux-columns-1.asp">Three column fluid CSS layout with faux columns and
100% height
</a></li>
244 <li>Example:
<a href=
"http://www.strictlycss.com/examples/fluid-css-layout-with-faux-columns-2.asp">Three column fluid CSS layout with faux columns
</a></li>
248 <p>You can use any of these examples for free. Hope you find them useful.
</p>
252 <!-- end centered div -->
254 <h3>Second in source
</h3>
256 <li><a href=
"#">Left menu
1</a></li>
257 <li><a href=
"#">Left menu
2</a></li>
258 <li><a href=
"#">Left menu
3</a></li>
261 <!-- end left div -->
262 <div class=
"clear"></div>
266 <h3>Third in source
</h3>
268 <li><a href=
"#">Right menu
1</a></li>
269 <li><a href=
"#">Right menu
2</a></li>
270 <li><a href=
"#">Right menu
3</a></li>
273 <!-- end right div -->
274 <div class=
"clear"></div>
278 <div id=
"footer"><p>This is our footer
</p>
281 <!-- If you copy the HTML on this page, do NOT copy the code below!
284 <script src=
"two-column-example_files/mlt.js" type=
"text/javascript"></script><img src=
"two-column-example_files/mlt.gif" height=
"1" width=
"1">
285 <!-- End Do NOT copy HTML -->