views:

94

answers:

4

I'm really thinking of going back to tables because this is just #¤€&/@£ always something....

<div style="float: left; width: 20%">
 #1 <a>SmokA</a><br />
 <small>Admin</small><br />
 <small>2009-08-07</small>
</div>

<div style="float: right; width: 80%">
 I would buy a boat
</div>

<div style="clear:both"></div>

<div style="border-top: 1px solid #071946; border-bottom: 1px solid #1D3060"></div>


<div style="float: left; width: 20%">
 #2 <a>BusHka</a><br />
 <small>Old school</small><br />
 <small>2009-08-07</small>
</div>

<div style="float: right; width: 80%">
 <a href="#comment1">#1</a> is stupid
</div>

<div style="clear:both"></div>
<div style="border-top: 1px solid #071946; border-bottom: 1px solid #1D3060"></div>

This gives: http://i29.tinypic.com/2iawh83.png

A huge space in the first div. why? it dont if theres more than 10 comments for some reason

ignore the stupid comments

A: 

I would be careful about having width of 20% and 80% expect to fit on one line: if there is any padding or border they won't. It looks the way it should in ff 3. :D

CrazyJugglerDrummer
You're right, but in the screenshot they do fit, so that's not the problem.
RichieHindle
A: 

Pasting your HTML into the body of my generic testing-HTML-code-from-Stack-Overflow file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd"&gt;
<html><head>
<title>Test</title>
</head><body>
<!-- Rebadow's code here -->
</body></html>

shows no problem. Your problem must lie elsewhere, like in your CSS for instance.

RichieHindle
A: 

if you are using IE6 using 20% with 80% with will often cause the line to overflow, i usually use 20% 79% and you should be ok

to see if it is something overflowing try adding overflow:hidden to the divs and see if they line up, if so you know its something overflowing.

have you used firebug or another inspection tool to see what the heights and widths actually are?

MJJames
A: 

Try adding a wrapper div around your floating ones. This is just to see if anything above this is affecting it somehow.

<div style="clear:both">
<div style="float: left; width: 20%">
 #1 <a>SmokA</a><br />
 <small>Admin</small><br />
 <small>2009-08-07</small>
</div>

<div style="float: right; width: 80%">
 I would buy a boat
</div>    
</div>

<div style="clear:both"></div>

<div style="border-top: 1px solid #071946; border-bottom: 1px solid #1D3060"></div>

Also I wouldn't make a div just to display a line, but that's another issue entirely. Maybe try a HR tag, or wrap that div around everything, this is just to make the code make more sense structurally.

Karl