2013-06-03 56 views
0

在IE和Chrome中工作,但在Firefox中對齊。有人可以幫助我嗎?問題符合「.menu_central .navegacao li」。 out「border:1px solid#000; width:215px;」工作但沒有工作。li div對齊中心 - Bug Firefox

我需要在Firefox中對齊中心。

<html> 
    <head> 
     <meta http-equiv="Content-Language" content="pt-br" /> 
     <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> 
     <style> 
      html { color: #000; background: #FFF; } 
      body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, textarea, p, blockquote, th, td { margin : 0; padding : 0; } 
      table { border-collapse : collapse; border-spacing : 0; } 
      fieldset, img { border : 0; } 
      address, caption, cite, code, dfn, em, strong, th, var { font-style : normal; font-weight : normal; } 
      li { list-style : none; } 
      caption, th { text-align : left; } 
      h1, h2, h3, h4, h5, h6 { font-size : 100%; font-weight : normal; } 
      q:before, q:after { content : ''; } 
      abbr, acronym { border : 0; font-variant : normal; } 
      sup { vertical-align: text-top; } 
      sub { vertical-align: text-bottom; } 
      input, textarea, select { font-family: inherit; font-size: inherit; font-weight: inherit; } 
      legend { color : #000; } 

      html, body { 
       margin-top: 0px; 
       margin-left: 0px; 
      } 
      .menu_central { 
       width: 100%; 
       position: fixed; 
       top: 0px; 
       left: 0px; 
       border-bottom: 1px solid #000; 
      } 
      .menu_central .navegacao { 
       line-height: 30px;    
       text-align : center;     

       /* Firefox */ 
       display: -webkit-box; 
       -moz-box-pack: center; 
       -moz-box-align: center; 

       /* Safari and Chrome */ 
       display: -webkit-box; 
       -webkit-box-pack: center; 
       -webkit-box-align: center; 

       /* W3C */ 
       display: box; 
       box-pack: center; 
       box-align: center; 

      } 
      .menu_central .navegacao li { 
       border: 1px solid #000; 
       width: 215px; 
      } 
     </style> 
    </head> 
    <body> 
     <div class="menu_central"> 
      <ul class="navegacao"> 
       <li><span class="inicial_nome">Q</span>uem Somos</li> 
      </ul 
     </div> 
    </body> 
</html> 
+1

請不要使用'0px'。這與'0brasileiros'一樣有意義。零是零!只需使用'0'! –

+0

替換邊框:1px實體#000與輪廓:1px實體#000;是一個骯髒的修復,但應該解決您的問題。 –

回答

0

您必須添加顯示:inline-block。

所以,你的代碼應該是這樣的:

.menu_central .navegacao li { 
    border: 1px solid #000; 
    width: 215px; 
    display: inline-block; 
} 
+0

ty man ...命令顯示:inline-block已工作。你知道爲什麼我只需要在Firefox中執行這個命令嗎? – user2448091

+0

對不起,但我不確定100%。很難說firefox有什麼問題。 –

0

正如我在評論說

替換:

border: 1px solid #000; 

有了:

outline: 1px solid #000; 

這是因爲,概括不佔用空間。所以它應該適用於每個瀏覽器。您可能需要爲其餘的div添加1px或2px,因爲邊框消失了。

+1

該問題與邊界無關。指中心對齊。 srdjan回答了我的問題..你幫忙......我也不知道他的命令。 – user2448091