Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > divs in the same row, but filling the row

Reply
Thread Tools

divs in the same row, but filling the row

 
 
Francesco Moi
Guest
Posts: n/a
 
      05-15-2007
Hi.

I want to place 5 divs within the same row:
div-div-div-div-div

My HTML:
-------------
<div class="content">
<div class="fooclass"><img src="image.jpg"></div>
<div class="fooclass"><img src="image.jpg"></div>
<div class="fooclass"><img src="image.jpg"></div>
<div class="fooclass"><img src="image.jpg"></div>
<div class="fooclass"><img src="image.jpg"></div>
<div class="fooclass"><img src="image.jpg"></div>
</div>
--------------

My CSS:
--------
div.fooclass
{
float:left;
background-color:red;
}
--------

However, the divs are really floating, and I went them to fill their
row, because I have to insert <br/> to fill this row.

Does anybody have a solution? Thank you very much.

 
Reply With Quote
 
 
 
 
John Hosking
Guest
Posts: n/a
 
      05-15-2007
Francesco Moi wrote:

> I want to place 5 divs within the same row:
> div-div-div-div-div


> <div class="fooclass"><img src="image.jpg"></div>
> <div class="fooclass"><img src="image.jpg"></div>
> <div class="fooclass"><img src="image.jpg"></div>
> <div class="fooclass"><img src="image.jpg"></div>
> <div class="fooclass"><img src="image.jpg"></div>
> <div class="fooclass"><img src="image.jpg"></div>


> div.fooclass
> {
> float:left;
> background-color:red;


display:inline;
/*presumably you have some padding and margins, too*/

> }


> However, the divs are really floating, and I went them to fill their
> row, because I have to insert <br/> to fill this row.


It won't always be five, but might be three or six, depending on the
width of the container (viewport). But that's what you really want,
isn't it?

HTH
--
John
 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two divs on the same line, but no horizontal scrollbar in IE, justpushes content down BerlinBrown HTML 11 09-09-2008 11:38 PM
swapping divs -- when divs NOT positioned absolutely.. maya Javascript 4 11-16-2007 05:11 PM
divs in the same row, but filling the row Francesco Moi HTML 0 05-15-2007 06:31 PM
Managing divs within divs.... rich HTML 0 02-02-2006 07:38 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM



Advertisments
 



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