如何让我的标签居中>

时间:2014-01-22 18:30:06

标签: html css tabs center blogger

我已经尝试将所有边距设为0自动,我尝试更改所有浮动:(中心而不是左侧)这只是在页面中间向下而不是跨越我的标签。我应该改变什么,在哪里?我也只更改CSS或HTML吗?

我的博客: (http://icantaffordmylifestyle.blogspot.com/

我的HTML:

<center>
<div id='mbtnavbar'> 
<ul id='mbtnav'> 

<li>   <a href=/ >| HOME</a> 
  </li> 
  <li>
  <a href="/p/about_12.html"> | ABOUT </a> 
         </li> 
<li><a href="/search/label/Life">| LIFESTYLE</a>
        <ul>
            <li><a href="/search/label/Music">| MUSIC</a></li>
            <li><a href="/search/label/DIY">| DIY</a></li>
            <li><a href="/search/label/My%20Art">| MY ART</a></li>
            <li><a href="/search/label/Nail%20art">| NAIL ART</a></li>            
<li><a href="/search/label/Beauty">| BEAUTY</a></li>
        </ul>
    </li>
<li><a href="/search/label/Daily%20Look%20Book">| FASHION</a>
        <ul>
            <li><a href="/search/label/Daily%20Look%20Book">| OOTD FASHIONS</a></li>
            <li><a href="/search/label/Lifestyle">| LIFESTYE LOOKS</a></li>
                    <li><a href="/search/label/Best%20and%20Worst">| FASHION RECAPS</a></li>
</ul>
    <li><a href="/p/nom.html">| OM-NOMNOM </a>
        <ul>
            <li><a href="/search/label/Nom%20Diaries">| NOM DIARIES</a></li>
            <li><a href="/search/label/Nomventure">| NOM-ventures</a></li>
            <li><a href="/search/label/Beverage%20Adventures">| LINKS TO MY DRINKS</a></li>
            <li><a href="/search/label/Healthy%20Noms">| HEALTHY NOMS</a></li>

        </ul>
    </li>

<li> 
<a href="/p/wish-list.html">| WISH LIST</a> 
</li> 
<li><a href="/p/pradvertising.html"> |  CONTACT</a>  
<ul>
            <li><a href="/p/hello-darling.html">| SERVICES</a></li>
            <li><a href="/p/disclaimer_13.html">| DISCLAIMER</a></li>
        </ul>          
    <!-- etc. -->

</li></li></ul></div>
</center>

我的CSS:

<center>
#mbtnavbar { 
/* background: #ffffff; */ 
width: auto; 
color: #3cd0b6; 
margin: 0 auto; 
padding: 0; 
position: relative; 
border-top:0px solid #ffffff; 
height: 40px; 
vertical-align: text-middle;
} 

#mbtnav { 
background: #ffffff; 
margin: 0; 
padding: 0; 
} 

#mbtnav ul { 
float: center; 
list-style: none; 
margin: 0; 
padding: 0; 
} 

#mbtnav li { 
list-style: none; 
margin: 0; 
padding: 0; 
/* border-left:1px solid#ffffff; 
border-right:1px solid #ffffff; */ 
vertical-align: text-middle;
}  

#mbtnav li a, #mbtnav li a:link, #mbtnav li a:visited { 
color: #3cd0b6; 
display: inline-block; 
font:bold 24px sue ellen francisco; 
margin: 0; 
padding: 6px 9px 7px 9px; 
text-decoration: none; 
} 

#mbtnav li a:hover, #mbtnav li a:active { 
background: #ffffff; 
color: #FC9F35; 
display: inline-block; 
text-decoration: none; 
margin: 0; 
padding: 6px 9px 7px 9px; 
} 

#mbtnav li { 
float: left; 
padding: 0; 
} 

#mbtnav li ul { 
z-index: 9999; 
position: absolute; 
left: -999em; 
height: 40; 
width: 200px; 
margin: 0 auto; 
padding: 0; 
} 

#mbtnav li ul a { 
width: 200px; 
} 

#mbtnav li ul ul { 
margin: -35px 0 0 161px; 
} 

#mbtnav li:hover ul ul, #mbtnav li:hover ul ul ul, #mbtnav li.sfhover ul ul, #mbtnav li.sfhover ul ul ul { 
left: -999em; 
} 

#mbtnav li:hover ul, #mbtnav li li:hover ul, #mbtnav li li li:hover ul, #mbtnav li.sfhover ul, #mbtnav li li.sfhover ul, #mbtnav li li li.sfhover ul { 
left: auto; 
} 

#mbtnav li:hover, #mbtnav li.sfhover { 
position: static; 
} 

#mbtnav li li a, #mbtnav li li a:link, #mbtnav li li a:visited { 
background: #ffffff; 
/* width: 200px; */ 
color: #3cd0b6; 
display: inline-block; 
font:bold 19px sue ellen francisco; 
margin: 0 auto; 
padding: 6px 9px 7px 9px; 
text-decoration: none; 
z-index:9999; 
border-bottom:1px dotted #333; 
} 

#mbtnav li li a:hover, #mbtnavli li a:active { 
background: #ffffff; 
color: #FC9F35; 
display: block; 
margin: 0 auto; 
padding: 6px 9px 7px 9px; 
text-decoration: none; 
} 

.tabs-inner .widget #mbtnavbar li a { 
border-left:none; 
} 

.tabs-outer .widget, .section { 
margin:0 auto; 
} 

.tabs-inner { 
padding: 0px; 
}

1 个答案:

答案 0 :(得分:0)

只需将display: inline-block;添加到#mbtnav

即可