Click to See Complete Forum and Search --> : positioning tabs within relative container


VaporAction
01-18-2007, 02:00 PM
I'm trying to make a site that has a centered page with centered navigation tabs at the top very similiar to...
http://www.apple.com

the part that is messing me up is the background image behind the tabs...

I can't seem to get the tabs to overlap the background image without using position: absolute...

if I use position absolute then the tabs don't stay in the right position with my relatively positioned page...

here's a diagram (just for example, not real html)

<div container position: relative; margin: auto;>
<div tabs background>
<div navigation tabs>
</div>

ray326
01-18-2007, 11:19 PM
Something like so
<div id="navBackground">
<div id="navContainer">
<ul id="navTabs">
<li>nav anchor</li>
<li>nav anchor</li>
<li>nav anchor</li>
<li>nav anchor</li>
</ul>
</div>
</div>

Centauri
01-19-2007, 12:13 AM
Don't try to use a background then line other elements over it - use backgrounds on the elements themselves. Suggest have a look at http://alistapart.com/articles/slidingdoors

Cheers
Graeme

VaporAction
01-19-2007, 09:20 AM
thanks that's a good article!