tags:

views:

24

answers:

3

Hello People,

I tried all sticky footer CCS examples. All of them work fine. However, I have an issue. Suppose I have this:

<div id="wrap">
  <div id="bodyleft">left</div>
  <div id="bodyright">right</div>
  <div id="footer">footer</div>
</div>

So, if I have height 100% for #bodyleft, the border will not extend to the end of the viewport up to the footer. It will just only cover one line of content.

Whether there is one line or 10 lines, I want the border to extend to the end of the page.

Any ideas?

Thanks!

Maria

EDIT:

<body>
<div id="wrap">

<div id="bodyleft">on left</div>
<div id="bodyright">
    some text on right<br />
</div>

</div>


  <div id="footer">footer </div>

</body>
</html>



* { margin:0px; padding:0px; }

html, body {height: 100%;}

#wrap {min-height: 100%;}

#footer {
        position: fixed; 
        bottom: 0; 
        background-color: #f00; 
        height: 20px; 
        width: 100%; 
        margin-top:-20px; /* negative value of footer height */
} 


#bodyleft{
    width:222px;
    float:left;
    border:1px solid black;
    overflow:auto;
    padding-bottom:20px;
}

#bodyright{
    width:777px;
    float:right;
    border:1px solid black;
    overflow:auto;
    padding-bottom:20px;
}
A: 

I may be wrong but I think 100% will only go high enough to display the contents of the div. I think you may have to go with using min-height.

Aaron Hathaway
Aaron, thank you. I have used all available variations, height, min-height, height auto, height %100... nothing works to extend the borders of the div.
MariaKeys
A: 

What you are trying to achieve (having the bottom border of the left div hitting the footer will be pretty tricky because you don't know the user screen size. You could do it with tables but that would pretty much ruin the whole markup code.

Can't you just simulate the bottom border?

+----------------------------+------------------------+
|  LEFT DIV                  |       SAME FOR RIGHT   |                 
|                            |                        |
+----------------------------+                        |
| DIV with 1px height        |                        |
| and same width as left div |                        |
| to simulate boder          |                        |
+----------------------------+------------------------+
|  FOOTER                                             |
+-----------------------------------------------------+
Frankie
Wow, you guys are so fast. Give me 5 mins please. Thanks Frankie.
MariaKeys
* { margin:0px; padding:0px; }html, body {height: 100%;}#wrap {min-height: 100%;}#footer { position: fixed; bottom: 0; background-color: #f00; height: 20px; width: 100%; margin-top:-20px; /* negative value of footer height */} #bodyleft{ width:222px; float:left; border:1px solid black; overflow:auto; padding-bottom:20px;}#bodyright{ width:777px; float:right; border:1px solid black; overflow:auto; padding-bottom:20px;}
MariaKeys
I added to original post. It is not possible to add to code to comments i think. My first time here.
MariaKeys
A: 

Frankie, thank you for your guidance. Yes user screen size is not known, but isn't height:100% for that? Why can't i just have a border around that height?

Also, why do i need to bother with sticky footers? Apparently your suggestion of position:fixed bottom:0 did the very same thing for footer.

MariaKeys