【问题标题】:How to center the tabs in a navigation bar如何使导航栏中的选项卡居中
【发布时间】:2013-07-06 07:29:21
【问题描述】:

如何在此导航栏中使标签居中?
这是我制作的导航栏的 html 和 css 代码。

它在 JSfiddle 上 http://jsfiddle.net/QPKe2/

<html> 
<body>

请帮忙..

【问题讨论】:

  • 喜欢this here?
  • @koala_dev 您应该将此作为答案发布,它是正确的,值得点赞
  • 将标题从“tebs”编辑为“tabs”

标签: css navbar


【解决方案1】:

我更新了你的fiddle,主要变化如下:

#cssmenu ul{
    text-align: center;
}

#cssmenu li{
    display: inline-block;
    /*float: left; remove this*/
}

#cssmenu li a{
    height:22px; /*add this here so all links have the same height*/
}

【讨论】:

    猜你喜欢
    • 2014-05-03
    • 1970-01-01
    • 2016-11-01
    • 2015-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多