Click to See Complete Forum and Search --> : inline boxes


chuvak
07-09-2003, 10:57 PM
Hi,

Is there a way to make boxes go side by side like words w/o using absolute positioning. DIVs just get under each other no matter what. If I specify inline display property then they shrink to the size of a text line.
Is there any way at all to make boxes of the same size behave like words (that is, if it doesn't fit in a line, go on the next row)?

please advice

thanks in advance

Hester
07-10-2003, 04:26 AM
You need float. It's pretty complex, but here goes:

Use {float:left;} - This makes boxes act like text. They will spill over if they don't fit a line. Only I had problems with them suddenly going down instead of along.

You can also use this to force a new line: {clear:both;}

The best thing to do is read up on how to use them. Here is a site that is very helpful:

http://positioniseverything.net

DaveSW
07-10-2003, 06:40 AM
you may need to specify a width for the float .

e.g.
{width:150px; float:left;}

you can use % as well