【问题标题】:Centering the Navigation bar居中导航栏
【发布时间】:2010-07-10 18:38:38
【问题描述】:

大家好,我有一个标准的导航栏,带有一个无序列表并使用精灵。我还使用 jquery 来渲染一些动画。一切正常。我在将条居中时遇到问题。它与左侧对齐。我试过使用 text-align:center 但这不起作用。我认为存在冲突的属性。你们能帮我把它放在中心吗?我不是那么大的 UI 开发人员!

.navbar {
 list-style-type: none;
 list-style-position:outside;
 position: relative;
 margin: 0;
 padding: 0; }

.navbar li{
display: block;
overflow: hidden;
padding: 0;
cursor: pointer;
float: left;
width: 125px;
height: 40px;
margin-right: 0px;
background-image:url(sprite.jpg);
background-repeat:no-repeat;

}
.navbar a{
display:block;
height:40px;
text-indent:-9999px;
outline:none;

}

【问题讨论】:

    标签: html css ajax


    【解决方案1】:

    你试过了吗?

    margin-left: auto;
    margin-right: auto;
    

    还是这样的?

    margin-left: 0px;
    margin-right: 0px;
    

    【讨论】:

      猜你喜欢
      • 2021-05-27
      • 2012-02-27
      • 2012-11-14
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多