html - 在导航 block 中间对齐导航链接

标签 html css twitter-bootstrap

我使用 startbootstrap-small-business 模板并尝试根据我的需要进行调整。 我添加了一个新 Logo 并被迫将导航栏的高度更改为 ca。 120 像素。 我现在需要/想要做的是垂直对齐 Logo 右侧的链接。他们需要在导航栏的中间。 我尝试为 line-height:60px 使用行高( @media {line-height:2px }.navbar-nav li a )导航栏的元素,它适用于正常的浏览器分辨率,但是当我更改浏览器的大小以检查它在小型设备中的外观时,行高不会通过@media 覆盖,它仍然需要 60px 的大小和 60px 的高度下拉菜单中的链接太大了。有人可以帮助我吗?

/*!
 * Start Bootstrap - Small Business HTML Template (http://startbootstrap.com)
 * Code licensed under the Apache License v2.0.
 * For details, see http://www.apache.org/licenses/LICENSE-2.0.
 */

body {
    padding-top: 110px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */
}

.navbar {
    min-height: 100px;
}


.navbar-fixed-top .nav {
    padding: 0;
}

.navbar-nav li a {
 line-height: 60px;
}

.navbar-fixed-top .navbar-brand {
    padding: 0 15px;
}

.navbar-inverse {
    background-color:#000;
}

footer {
    padding: 30px 0;
}

@media(min-width:@screen-sm-min) {
    body {
        padding-top: 110px; /* Required padding for .navbar-fixed-top. Change if height of navigation changes. */
    }

    .navbar-fixed-top .navbar-brand {
        padding: 0;
    }

    .navbar-nav li a {
       line-height: 2px;
     }
}

最佳答案

我在这个主题的帮助下得到了它: Bootstrap 3 Navbar with Logo。 这正在解决我的问题

@AmperPil 你的想法对我来说行不通 ;) 无论如何感谢你的帮助

关于html - 在导航 block 中间对齐导航链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30426960/

相关文章:

javascript - 使用 jquery 创建轮播效果 - 循环仅返回数组中的最后一个值

html - 使用 CSS 滚动具有视差效果

html - 带导航的全屏页面幻灯片

javascript - 从 JS 更改 CSS 不起作用

html - Div 不清除 float

html - 我希望所有屏幕尺寸的 Logo 和标题居中

javascript - 在 HTML 中向下滚动

html - 浏览器窗口横向收缩时正文背景图片不横向移动

javascript - 如何延迟jquery悬停事件

javascript - 制作 Bootstrap 弹出窗口模式?