Previous Message
Next Message

List as Navigation

Sent by Christian Heilmann on 31 October 2004 22:10


Robert Dumas wrote:

>I'm creating the new version of my site and I'm trying to get the
>navigation centered. You can see a rough of the header and navigation
>at http://obnoxio.us/dumpbox/rdo/ (the stylesheet is "layout.css"). I
>want the navigation to be centered in the navigation bar, but I don't
>know how.
>
>Can someone help me with this?
>  
>
You need to set a width to the navigation and then set its margin to 0 
auto. For older IEs you also need to set the  text-align  of the parent 
element to center. The auto margin will also mean that you'll have to 
apply the background  image to the parent element. The  easiest option 
is to add a DIV around the navigation UL and make the changes to that one:

<div id="navigation">
<ul.......>
</div>

and 

#navigation{
    text-align:center;
    background: transparent url(images/navbarbg.gif) repeat-x;
}
#navigation  ul{
    width:30em;
    margin:0 auto;
}

By  the way,  your skip links are useless when you hide them via 
display:none
http://css-discuss.incutio.com/?page=ScreenreaderVisibility

HTH

Chris




______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: