469,946 Members | 1,787 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,946 developers. It's quick & easy.

Showing divs side by side

What would be the best way to make four roughly square divs line up in
a horizontal row on a page? I've tried display:inline; with no luck
(it just destroyed the box shape) and at the moment I've got a very
messy solution with display:table-cell - I had to put   between
each div as margin had no effect.

Any ideas? Greatly appreciated.

A

Jul 19 '07 #1
3 5653
On 2007-07-19, Adam <ki*************@gmail.comwrote:
What would be the best way to make four roughly square divs line up in
a horizontal row on a page? I've tried display:inline; with no luck
(it just destroyed the box shape) and at the moment I've got a very
messy solution with display:table-cell - I had to put &nbsp; between
each div as margin had no effect.

Any ideas? Greatly appreciated.
Make them float: left.

display: inline-block would be ideal, but is not widely supported.
Jul 19 '07 #2
Well bust mah britches and call me cheeky, on Thu, 19 Jul 2007 21:02:24 GMT
Adam scribed:
What would be the best way to make four roughly square divs line up in
a horizontal row on a page? I've tried display:inline; with no luck
(it just destroyed the box shape) and at the moment I've got a very
messy solution with display:table-cell - I had to put &nbsp; between
each div as margin had no effect.

Any ideas? Greatly appreciated.
As Ben C said, floats are the answer. But read-up on "clear" for what
follows.

--
Neredbojias
A self-made man who worships his creator
Jul 20 '07 #3
On 19 Jul, 22:02, Adam <kindredhyper...@gmail.comwrote:
Any ideas? Greatly appreciated.
Use float

Read http://brainjar.com/css/positioning/ for a guide to the gory
details. It's easy to put the <div>s where you want, getting things to
sort themselves out afterwards (with clear) needs a bit more digging.

Jul 20 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Michael Ramey | last post: by
4 posts views Thread by Aaron | last post: by
15 posts views Thread by red | last post: by
5 posts views Thread by squidco | last post: by
6 posts views Thread by Mel | last post: by
5 posts views Thread by gregmercer | last post: by
jhardman
3 posts views Thread by jhardman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.