I have a very simple sub-navigation that I'm trying to create on top of the top of the content area on my website, but CSS has no easy solutions for such a common problem: I want either 3 or 4 evenly distributed DIVs at the top of the page.
1), for example. 3 Variable-Width, evenly distributed DIVs
[[LEFT] [CENTER] [RIGHT]]
2), for example. 4 Variable-Width, evenly distributed DIVs
[[LEFT] [LEFT CENTER] [RIGHT CENTER] [RIGHT]]
My solution for the first problem with the three DIVs was to float the left and right DIVs, and then assign an arbitrary size to the middle DIV and give it "margin: 0 auto". This is not quite a solution, but assuming that there are no changes in navigation, it gives an approximate approximation of what I want the results to be.
The solution that I have for the second problem with 4 DIVs is to simply center the DIVs just like before, but then float the two DIVs inside it, e.g.
[[LEFT] [[LEFT CENTER] [RIGHT CENTER]] [RIGHT]]
But again, this requires applying an arbitrary size to the middle DIV for alignment, and if any changes to the language or image are made to the site, the alignment values ββmust be recalculated. In addition, it is simply a complex solution that requires combining the structure with the presentation.
Any help is appreciated.
EDIT 07/20/2012 5:00 PM
Ok, I put the table-cell solution in place using percentages, but I ran into another problem in my slightly more complex implementation: the problem is that every DIV I mentioned is actually a container for two more DIVs, which are pairs of icons, embedded either floating or on the display: inline-block.
eg. http://jsfiddle.net/c3yrm/1/
As you can see, the last item in the list does not display properly.
Any help is welcome again!
EDIT 07/20/2012 7:16 PM
Final solution using arttronics: http://jsfiddle.net/CuQ7r/4/