CSS Test: Three columns layout

Last modified by XWikiGuest on 2021/05/03 08:09

The header and footer must have 100% width and their heights can vary.

The side columns must have a fixed width (200px) with a 16px padding and a 10px horizontal distance from other elements.

The whole ensemble (content + side columns) fills the entire window width.

Task: Write 2 CSS files:

  • The first one for places the content between the two columns:

          [ col1 ] [ the content ] [ col2 ]

  • The second places both side columns after the content

          [ the content ] [ col1 ] [ col2 ]

  • Bonus:

          [ the content ] [ col2 ] [ col1 ]

Note: The layouts must be identical in all browsers (to test on IE6, FF). No changes allowed in the HTML.

Note 2: You can use the Copy entry from the Page menu to create a copy of this document for the second stylesheet.

Edit CSS

<div id="all">
 <div id="header">The header</div>
 <div id="wrapper1">
   <div id="wrapper2">
     <div id="wrapper3">
       <div id="content">
          The content
       </div>
     </div>
     <div id="sideColumn1">
        The first side column
     </div>
   </div>
   <div id="sideColumn2">
      The second side column
   </div>
 </div>
 <div id="footer">The footer</div>
</div>
The content
The first side column
The second side column