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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 26th, 2007, 18:01
Aso's Avatar
Aso Aso is online now
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,012
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
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)
Reply With Quote

  #2 (permalink)  
Old Nov 26th, 2007, 21:22
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
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!
Reply With Quote
  #3 (permalink)  
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)
Reply With Quote
  #4 (permalink)  
Old Nov 26th, 2007, 23:56
SuperMember

SuperMember
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.
Reply With Quote
  #5 (permalink)  
Old Nov 27th, 2007, 00:37
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
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)
Reply With Quote
  #6 (permalink)  
Old Nov 27th, 2007, 01:00
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
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
Reply With Quote
  #7 (permalink)  
Old Nov 27th, 2007, 01:06
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
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)
Reply With Quote
  #8 (permalink)  
Old Nov 27th, 2007, 01:23
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
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.
Reply With Quote
  #9 (permalink)  
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)
Reply With Quote
  #10 (permalink)  
Old Nov 27th, 2007, 02:01
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
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.
Reply With Quote
  #11 (permalink)  
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)
Reply With Quote
  #12 (permalink)  
Old Nov 27th, 2007, 08:04
SuperMember

SuperMember
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".
Reply With Quote
  #13 (permalink)  
Old Nov 27th, 2007, 12:12
Aso's Avatar
Aso Aso is online now
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,012
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
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)
Reply With Quote
  #14 (permalink)  
Old Nov 27th, 2007, 12:13
SuperMember

SuperMember
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!
Reply With Quote
  #15 (permalink)  
Old Nov 27th, 2007, 12:39
JustinStudios's Avatar
SuperMember

SuperMember
Join Date: Mar 2007
Location: USA
Posts: 406
Blog Entries: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to JustinStudios
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.
Reply With Quote
  #16 (permalink)  
Old Nov 27th, 2007, 12:42
karinne's Avatar
SuperMember

SuperMember
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
Reply With Quote
  #17 (permalink)  
Old Nov 27th, 2007, 12:49
SuperMember

SuperMember
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).
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
CSS stretch footer vertically? uqwebdesign Web Page Design 2 Oct 24th, 2006 20:09


All times are GMT. The time now is 16:28.


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