3 column 100% Height, just problem with footer

This is a discussion on "3 column 100% Height, just problem with footer" within the Web Page Design section. This forum, and the thread "3 column 100% Height, just problem with footer are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack (1) Thread Tools
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old Feb 26th, 2007, 15:59
New Member
Join Date: Feb 2007
Location: UK
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
3 column 100% Height, just problem with footer

HI Please see the code below: This is a 3 column layout that is set to 100% height (with header and footer) my problem is the display of the footer in IE and FF on PC.. not tested on Mac yet. The footer does not show at all in FF, any ideas?

HTML: Select all
 
<html>
 <head>
  <title>3 Columns Equal Height.</title>
  <style type="text/css">
body {
font-size:12px;
font-family:Arial;
color: black;
background-color: #f1f1f1;
text-align: center; /* centering the content for IE6 */
}
#wrapper {
display:table; /* must put this in for FireFox. */
width:777px;
margin:auto; /* for IE6 and Firfox centering */
text-align:left; /* so that IE6 and Firefox puts the text to the left
*/
/*border:1px solid blue;*/
height:400px; /* Have to put SOMETHING in here for the height for both
browser. DO NOT put in a percentage, must be a pixel value */
}
#header{
background-color: red;
}
#mainMenu{
background-color: yellow;
}
#sidebar {
float:left; /* float the menu to the left */
width:150px;
background-color:#666666;
/*border:1px solid red;*/
height:100%; /* so the menu has the height of the main content and
visa versa */
}
#sidebarRight
{
width:100px;
float:right;
background-color:#999999;
height:100%;
}
#main {
float:left; /* float the content to the right */
width:527px;
border:0px solid green;
background-color:#CCCCCC;
height:100%;/* so the content has the height of the menu and visa versa */
}
#footer{
background-color:#00FFCC;
height:50px;
float:left;
}
/* make it so that the main content has a 5px "padding" in both Ie and
FireFox. */
#mainpadding {
margin:5px;
}
</style>
 </head>
 <body>
  <div id="wrapper">
   <div id="header">Header</div>
   <div id="mainMenu">Main Menu</div>
   <div id="sidebar">
    <h2>Menu</h2>
    <p>test</p>
    <p>test</p>
    <p>test</p>
   </div>
   <div id="main">
    <div id="mainpadding">
     <h2>Main Content</h2>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
     <p>test</p>
    </div>
   </div>
   <div id="sidebarRight">right</div>
   <div id="footer">Footer</div>
  </div>
 </body>
</html>
 
Reply With Quote

  #2 (permalink)  
Old Feb 26th, 2007, 21:35
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
Re: 3 column 100% Height, just problem with footer

I'm afraid your 3 columns of equal height was a lucky ellusion. It doesn't work that way. There are problems with the way browsers interprit the 'height: 100%' style.

In the code below, I have changed you layout structure and added some additional styles and I have added a line to your footer style.

What I suggest you do to create the ellusion of equal columns is to create an image 1px high and the width of your central div that matches your column colours and widths.

Set this as a background image with a repeat in the x direction.

Code: Select all
 <html> <head> <title>3 Columns Equal Height.</title> <style type="text/css">
body {
font-size:12px;
font-family:Arial;
color: black;
background-color: #f1f1f1;
text-align: center; /* centering the content for IE6 */
}
#wrapper {
display:table; /* must put this in for FireFox. */
width:777px;
margin:auto; /* for IE6 and Firfox centering */
text-align:left; /* so that IE6 and Firefox puts the text to the left
*/
/*border:1px solid blue;*/
height:400px; /* Have to put SOMETHING in here for the height for both
browser. DO NOT put in a percentage, must be a pixel value */
}
#header{
background-color: red;
}
#mainMenu{
background-color: yellow;
}
#sidebar {
float:left; /* float the menu to the left */
width:150px;
background-color:#666666;
/*border:1px solid red;*/
height:100%; /* so the menu has the height of the main content and
visa versa */
}
#sidebarRight
{
width:100px;
float:right;
background-color:#999999;
height:100%;
}
#main {
float:left; /* float the content to the right */
width:527px;
border:0px solid green;
background-color:#CCCCCC;
height:100%;/* so the content has the height of the menu and visa versa */
}
#footer{
background-color:#00FFCC;
height:50px;
float:left;
clear: both; /* Added this line here. */
}
/* make it so that the main content has a 5px "padding" in both Ie and
FireFox. */

/* New styles. */
#central {
    position: relative;
}

h2 {
    padding: 5px;
   margin: 0;
}

p {
    padding: 10px 5px 0 5px;;
   margin: 0;
}

</style> 
</head> 
<body> 
    <div id="wrapper"> 
       <div id="header">Header</div> 
      <div id="mainMenu">Main Menu</div>
      <div id='central'> <!-- This div wraps around the three parts of the central section -->
         <div id="sidebar"> <h2>Menu</h2> <p>test</p> <p>test</p> <p>test</p> </div> 
         <div id="main"> 
             <h2>Main Content</h2> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> <p>test</p> 
           </div> 
         <div id="sidebarRight">right</div> 
      </div>
      <div id="footer">Footer</div> 
    </div> 
</body> 
</html>
Reply With Quote
  #3 (permalink)  
Old Feb 27th, 2007, 13:38
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 3 column 100% Height, just problem with footer

Nice of you Geoff. Now if you'll explain what an ellusion is . . .
Reply With Quote
Reply

Tags
100 height, column

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.webforumz.com/web-page-design/23065-3-column-100-height-just-problem.htm
Posted By For Type Date
Article Feed » 3 column 100% Height, just problem with footer This thread Pingback Feb 26th, 2007 17:27

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS footer problem dangergeek Web Page Design 14 Nov 7th, 2007 20:41
Column Problem Kovo Web Page Design 2 Oct 1st, 2006 13:05
firefox footer problem... meccano Web Page Design 3 Jul 1st, 2006 21:19
2 column layout, footer problem svenjafour Web Page Design 13 Dec 1st, 2005 09:25
3 col layout: footer problem jswebdev Web Page Design 1 Oct 4th, 2005 03:00


All times are GMT. The time now is 02:29.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43