Div stretch to bottom in IE6

This is a discussion on "Div stretch to bottom in IE6" within the Web Page Design section. This forum, and the thread "Div stretch to bottom in IE6 are both part of the Design Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 26th, 2007, 18:01
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Question Div stretch to bottom in IE6

A div with styles;

Code: Select all
width: 23px;
position: absolute;
left: 28px;
top: 267px;
bottom: 0;
works great in FF, IE7 and Opera. The div is basically a 'post' that starts 267px from the top and stretches to the bottom of the page (using bottom: 0)

However, the success is not the same in IE6. I've tried height: 100% with a top margin but get the same results. The post won't stretch unless I give it a height value in px or similar (which of course will become too short or too long in a different screen res). Any clues?

Many thanks

Alex
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 26th, 2007, 21:22
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

I've got the same issue with a site I am working on too. A visual of the problem can be seen at www.justudios.com/Taneya . Only a problem in IE6. If I can find a solution to this problem I will post back, if not and someone else can help us that'd be wonderful too. Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 26th, 2007, 23:18
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Hmm... A lot of people seem to have this problem, huh? The solution is to use Faux Columns...
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 26th, 2007, 23:56
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Try adding 100% height to the body.
Code: Select all
body { 
 margin:0; 
 padding:0; 
 height:100%; 
}
Then add height:100% also to the div that you showed in your post Alex:
Code: Select all
width: 23px;
position: absolute;
left: 28px;
top: 267px;
bottom: 0;
height: 100%;
}
I might be off, but in search the net for the answer, the 100% of the div
will not work because it's 100% of nothing. But by adding the 100%
to the body tag, it will probably work.
Crossing finger.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 27th, 2007, 00:37
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Div stretch to bottom in IE6

HTML: Select all
width: 23px;
position: absolute;
left: 28px;
top: 267px;
bottom: 0;
height: 100%;
I tried with this css (like Lchad suggested), and it work's fine in both FF and IE7.
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 27th, 2007, 01:00
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

I tried using the height: 100% option and works fine in IE6, but doesn't do anything for me in FF or IE7. As for Faux Columns, I get what that guy is saying but in my case it wouldn't do me any good because it can only be used in set layouts and my design is fluid. So I had to figure something else out... Then it hit me... Spacer images. Yes, I know spacer images aren't the best solution, but it is an easy fix. The spacer image can be 1px in width and be as long as you need it to be. This will make the column be the size you need it to be.

If your text is dynamic then this is where we have a problem.

I'm still looking for a better solution but haven't found anything so far as easy to use, or as versatile as a spacer image.

Faux columns aren't a bad idea I guess, but they do limit you to a specific design type.

Last edited by JustinStudios; Nov 27th, 2007 at 01:01. Reason: Numberd Browser Wrong
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 27th, 2007, 01:06
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,612
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: Div stretch to bottom in IE6

That's weired! My IE7 and FF behave nicely!
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Nov 27th, 2007, 01:23
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Ok, I found out why mine doesn't work in IE7/FF I don't use positioning. My sites a fluid layout, and therefore its all setup based on divs and floats.

When I used positioning this fixed, but of course I can't use it.

I also found that if you have more text then 100% screen size Example - you have to scroll down to read, the 100% height fix doesn't work anymore. One column expands to fit the content, whilst the other stays at the 100% height line.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Nov 27th, 2007, 01:35
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Yes, css becomes tricky when you use fluid layouts...
I haven't some across any fixes for "filling the column", but I think padding is better than a spacer!
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Nov 27th, 2007, 02:01
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

The reason you can't use padding is because your content is different lengths on each page. So you'd have to have a different style sheet for each page, or, dare I say, inline styles (There goes the validation).

With a spacer your not adding any code and not doing anything wrong by validation rules. Now SEO you might take a hit, but I doubt it could be that bad.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Nov 27th, 2007, 02:03
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Oh, ok. I see what you're saying now (my brain wasn't working...)
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Nov 27th, 2007, 08:04
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

If you want equal-height columns, the obvious solution is "display: table-cell".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Nov 27th, 2007, 12:12
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,341
Blog Entries: 2
Thanks: 11
Thanked 49 Times in 46 Posts
Re: Div stretch to bottom in IE6

Lchad, you're a legend I can't believe how simple that was!
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Nov 27th, 2007, 12:13
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

I learned something new too! Glad it worked!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Nov 27th, 2007, 12:39
JustinStudios's Avatar
Reputable Member
Join Date: Mar 2007
Location: USA
Posts: 404
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Hrmm, Mike can you explain the table-cell more. I'm doing google searches atm but haven't come across anything too creative yet. I've also been toying around with the coding to fix this. My problem is I'm using a fluid layout, positioning is a no go for me. Well, I dont use positioning on hardly any of my layouts, even static, but that's because I was taught to steer clear of them unless you got into a situation where it was absolutely the last resort.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Nov 27th, 2007, 12:42
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

Quote:
Originally Posted by JustinStudios View Post
Hrmm, Mike can you explain the table-cell more. I'm doing google searches atm but haven't come across anything too creative yet. I've also been toying around with the coding to fix this. My problem is I'm using a fluid layout, positioning is a no go for me. Well, I dont use positioning on hardly any of my layouts, even static, but that's because I was taught to steer clear of them unless you got into a situation where it was absolutely the last resort.
See this thread - CSS - dynamic height div
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Nov 27th, 2007, 12:49
Most Reputable Member
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Div stretch to bottom in IE6

"display: table-cell" is not positioning. Positioning is setting "position: relative/absolute/fixed".

It simply works as a table would. Why spend all this effort to replicate table designs with floats, when you can use a <div> as a <table>? (And you can still use floats inside the "table".)

The downside is that IE doesn't support it, but this can be fixed with a javascript hack for IE (see the other thread).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to get my footer to stretch Gav Web Page Design 3 Dec 16th, 2007 14:15
[SOLVED] wont stretch lostyboy Web Page Design 2 Oct 18th, 2007 14:25
stretch div with no content nate2099 Web Page Design 4 Jul 13th, 2007 13:36
Site Stretch with Content? CodyFunderburg Web Page Design 4 Nov 20th, 2006 14:58