Forum Moderators: not2easy

Message Too Old, No Replies

How do I center these tabs?

CSS, Left Justified Tabs - Need to be Centered

         

zaytran

2:19 pm on May 30, 2006 (gmt 0)

10+ Year Member



Hi: This CSS creates a nice set of tabs that are right justified. What should be changed to make them centered?

Ted

/* CSS Tabs */
.navlist {
padding: 2px 0;
margin-left: 2;
border-bottom: 1px solid #778;
font: Bold 14px Arial Narrow;
}

.navlist li {
list-style: none;
margin: 0;
display: inline;
}

.navlist li a {
padding: 2px 0.5em;
margin-left: 2px;
border: 1px solid #778;
border-bottom: none;
background: #DDE;
text-decoration: none;
}

.navlist li a:link { color: #000080; }
.navlist li a:visited { color: #000080; }

.navlist li a:hover {
color: #000;
background: #AAE;
border-color: #227;

}

GoWFB_SEO

5:23 pm on May 30, 2006 (gmt 0)

10+ Year Member



i think you need to to specify a proper "margin-left". it depends on the width you set for the body tag and the width you set for your navigation bar

zaytran

5:40 pm on May 30, 2006 (gmt 0)

10+ Year Member



Sorry, the tabs are LEFT justified.

The page is 100% wide.

Ted

Setek

4:50 am on May 31, 2006 (gmt 0)

10+ Year Member



Your
li
's are set as inline elements, and your
a
's are set as inline elements, so you really should just have to
text-align: center;
the
.navlist
:)

zaytran

2:51 pm on May 31, 2006 (gmt 0)

10+ Year Member



Thanks Setek!

That worked!

Ted