Previous Message
Next Message

2-Col Float Problem

Sent by Zoe M. Gillenwater on 30 November 2004 13:01


Pringle, Ron wrote:

>I have a containing div with two divs inside it, both floated left, followed
>by a clearing div. There is a large gap between the second div and the
>righthand side of the containing div that I cannot seem to eliminate.
>  
>
><code snipped>
>
>HTML: http://www.aurora-il.org/testsite/events.htm
>
>CSS: http://www.aurora-il.org/testsite/includes/default02.css
>
>  
>

Ron,

The gap is there because the left box has no width applied and is thus 
only as large as the longest line of text within.  You can see this by 
increasing your font size -- the left box will grow and the gap will get 
smaller.  You want the box to be 40%, but it is dangerous to set it to 
40% because of rounding errors that could occur and cause slight 
overlaps or drops.  Instead, I'd go with a method like Jim's where you 
only float one box.  Of course, then you could run into the three pixel 
float gap, so I guess it's a case of picking your poison. :-)  I suppose 
since you are using containers that position: absolute would also work 
though!

Zoe

-- 
Zoe M. Gillenwater
Design Specialist
Highway Safety Research Center
http://www.hsrc.unc.edu

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread:

Possibly related: