[thelist] aligning floated divs.

Mike Stenhouse Mike.Stenhouse at spiritsoft.com
Tue Mar 25 08:25:14 CST 2003


Hi Liam

I did something similar a while back by putting each row of floating
divs in another div, emulating a table layout. To make the divs wrap
nicely you just have to put clear:left; on that container. e.g.

div.row {
	clear:left;
}

So what you end up with looks something like this:

<div class="row">
<div class="float"><img /></div>
<div class="float"><img /></div>
<div class="float"><img /></div>
</div>

<div class="row">
<div class="float"><img /></div>
<div class="float"><img /></div>
<div class="float"><img /></div>
</div>

I hope I've remembered that right... Best of luck!

Mike


-----Original Message-----
From: Liam Delahunty [mailto:ldelahunty at britstream.com] 
Sent: 25 March 2003 14:25
To: Thelist
Subject: [thelist] aligning floated divs.

<snip>
div.float {
	float: left;
	width: 120px;
	border: 1px solid #000000;
	text-align: center;
	background-color: #ffffff;
	margin: 2px;
	padding: 2px;
	}

I want:
{} {} {} {}
{} {} {} {}

But if the heights vary I can get:
{} [] {} {}
	{} {}
{} {} [] {}
         {}
</snip>

This message contains confidential information and is intended only for the named individual and may not be disseminated without prior permission.  If you are not the named addressee, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this message in error and delete this e-message from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, delayed in transmission, incomplete, or may contain viruses. The sender therefore does not accept liability for any errors or omissions in the contents of this Message which arise as a result of e-mail transmission.  If verification is required please request a hard-copy version. This message is provided for informational purposes and should not be construed as a solicitation or offer to buy or sell any software or services.

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. http://www.messagelabs.com
________________________________________________________________________


More information about the thelist mailing list