[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 08-26-2008, 08:27 PM   #1 (permalink)
vinedomains.com
 
1901gt's Avatar
 
Join Date: Mar 2005
Location: singapore
Posts: 1,735
99.95 NP$ (Donate)

1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all

Animal Cruelty
Question XHTML Question: Best way to make div height 100%?

Let say, I have this example.

Code:
<div id="container">

<div class="contentA left">Lorem lipsum</div>
<div class="contentB right">Lorem lipsum</div>

</div>
.. where left and right is float left and right respectively.

What is the best method (must be validated) to make the container's height 100% or fluid without declaring a fixed height value?

I seems to have some problem with this whenever there is floats inside the div.

Before, I used to use this:

Code:
#container {
overflow: auto;
height: 100%;
min-height: 100%;
}
But sometimes, the horizontal and vertical scrollbars will appear inside the div, especially in IE7.
__________________
Domains For Sale:
HUMOO.com | CAFOO.com | VAJOO.com | PEPOO.com | MOCAU.com | JASLI.com | LUVVO.com | DINOMO.com | MajorBlogs.com | LatestMovies.net
1901gt is online now  
Old 08-26-2008, 08:31 PM   #2 (permalink)
Senior Member
 
Epic's Avatar
 
Join Date: Sep 2005
Posts: 3,782
518.09 NP$ (Donate)

Epic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond reputeEpic has a reputation beyond repute


Clear the floats. This isn't necessarily the best way to do it, but it works.

Code:
<div id="container">

<div class="contentA left">Lorem lipsum</div>
<div class="contentB right">Lorem lipsum</div>

<div style="clear: both;"> </div>
</div>
Epic is offline  
Old 08-26-2008, 09:52 PM   #3 (permalink)
vinedomains.com
 
1901gt's Avatar
 
Join Date: Mar 2005
Location: singapore
Posts: 1,735
99.95 NP$ (Donate)

1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all

Animal Cruelty
Ok great! Works well for me.
__________________
Domains For Sale:
HUMOO.com | CAFOO.com | VAJOO.com | PEPOO.com | MOCAU.com | JASLI.com | LUVVO.com | DINOMO.com | MajorBlogs.com | LatestMovies.net
1901gt is online now  
Old 09-10-2008, 12:24 AM   #4 (permalink)
vinedomains.com
 
1901gt's Avatar
 
Join Date: Mar 2005
Location: singapore
Posts: 1,735
99.95 NP$ (Donate)

1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all1901gt is a name known to all

Animal Cruelty
I think I've found a better way. Silly me.
Just insert the following inside the div and it will auto expand.

Code:
#container {
overflow: hidden;
}
__________________
Domains For Sale:
HUMOO.com | CAFOO.com | VAJOO.com | PEPOO.com | MOCAU.com | JASLI.com | LUVVO.com | DINOMO.com | MajorBlogs.com | LatestMovies.net
1901gt is online now  
Old 09-11-2008, 03:17 PM   #5 (permalink)
Carpe Diem
 
Join Date: Apr 2007
Location: United States - OHIO
Posts: 612
226.00 NP$ (Donate)

Phaethon is a glorious beacon of lightPhaethon is a glorious beacon of lightPhaethon is a glorious beacon of lightPhaethon is a glorious beacon of lightPhaethon is a glorious beacon of light

Cystic Fibrosis Save a Life
That should work, but if I remember correctly that could cause some of the content in the container to get cut off.
__________________
:love: NamePros :love:
Phaethon is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 03:13 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85