Hi guys,
I am fairly new to CSS and wanted to see about the best way to center some things horizontally.
I have a div container holding 4 separate divs that are all floated left so that they stack horizontally. However, I want them to be equal distance apart from each other and be centered within the container div. I tried using text-align: center in the container but that didn't work. So then I added some space to each of the left margins of each separate div to "emulate" this effect. You can see it here: where it says TOP REAL ESTATE LISTINGS.
In IE I got it pretty close. In Firefox it sits too far left.
What's the *right* way to get these divs centered and equal distance from each other?
Thanks for any suggestions.
Dave Fore
I am fairly new to CSS and wanted to see about the best way to center some things horizontally.
I have a div container holding 4 separate divs that are all floated left so that they stack horizontally. However, I want them to be equal distance apart from each other and be centered within the container div. I tried using text-align: center in the container but that didn't work. So then I added some space to each of the left margins of each separate div to "emulate" this effect. You can see it here: where it says TOP REAL ESTATE LISTINGS.
In IE I got it pretty close. In Firefox it sits too far left.
What's the *right* way to get these divs centered and equal distance from each other?
Thanks for any suggestions.
Dave Fore