Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2007, 10:05 PM
Adam
Guest
 
Posts: n/a
Default 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

  #2  
Old July 19th, 2007, 10:15 PM
Ben C
Guest
 
Posts: n/a
Default Re: Showing divs side by side

On 2007-07-19, Adam <kindredhyperion@gmail.comwrote:
Quote:
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.
  #3  
Old July 20th, 2007, 06:35 AM
Neredbojias
Guest
 
Posts: n/a
Default Re: Showing divs side by side

Well bust mah britches and call me cheeky, on Thu, 19 Jul 2007 21:02:24 GMT
Adam scribed:
Quote:
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
  #4  
Old July 20th, 2007, 11:05 AM
Andy Dingley
Guest
 
Posts: n/a
Default Re: Showing divs side by side

On 19 Jul, 22:02, Adam <kindredhyper...@gmail.comwrote:
Quote:
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.

 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles