[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 924
  • Last Modified:

Floating two side by side div boxes to the center of a containing div

How could i float two side by side div boxes to the center of a containing div.

I need the  div boxes to remain in the center of the page regardless of the size of the browser window. But if there is room for them both to be displayed side by side that is how they should be displayed. ( still remaining in the center )

Any ideas?
<div aling="center" id="visiableContentWraper" style="width:100%;">
	<div id="automotive" style="float:left; width:520px;">
		content for automotive		
	</div>
	<div id"realEstate" style="float:left; width:520px;">
		content for realEstate
	</div>
</div>

Open in new window

0
Cybervanes
Asked:
Cybervanes
  • 3
  • 2
1 Solution
 
David S.Commented:
I suggest you use display:inline-block (with browser workarounds) instead of float:left. This explains how:
http://www.search-this.com/2007/09/19/when-is-a-float-not-a-float/
0
 
CybervanesAuthor Commented:
Yeah I already tryed that and I cant get it to work. Divs overlapping and only the far left side of the first div is aligned on the center line.

Thanks tho!
0
 
David S.Commented:
Please show us your the code you used when you tried that technique.  It is tricky, but I've used it many times myself.
0
 
David S.Commented:
Ah. This is the other question I posted the wrong example link to. Sorry about that.

Check out the technique shown here:
http://www.dynamicsitesolutions.com/css/example-menus/4/
http://gtwebdev.com/workshop/layout/inline-block-gallery.php
0
 
CybervanesAuthor Commented:
Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now