html - (Bootstrap 3) 如何让小屏幕上的导航栏与大屏幕上的导航栏显示相同

标签 html css twitter-bootstrap responsive-design navigation

我正在创建一个固定在屏幕顶部的 Bootstrap 导航栏,但在小屏幕上我不希望出现下拉文本的汉堡包按钮。相反,我只想让文本显示在导航栏上,就像在大屏幕上一样。

这是我的导航栏代码

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">Logo</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav navbar-right">
                <li class="active"><a href="home.html">Home <span class="sr-only">(current)</span></a></li>
                <li><a href="about.html">About</a></li>
                <li><a href="#">Login</a></li>
            </ul>
        </div>
    </div>
</nav>

如何在小屏幕上使导航栏上的文本与大屏幕上导航栏上的文本显示相同?

最佳答案

Changing the collapsed mobile navbar breakpoint

The navbar collapses into its vertical mobile view when the viewport is narrower than @grid-float-breakpoint, and expands into its horizontal non-mobile view when the viewport is at least @grid-float-breakpoint in width. Adjust this variable in the Less source to control when the navbar collapses/expands. The default value is 768px (the smallest "small" or "tablet" screen).

这是该特定变量所在的位置:https://github.com/twbs/bootstrap/blob/57260f16b364e4cb559cd65159197fd1cf5248f7/less/variables.less#L321

关于html - (Bootstrap 3) 如何让小屏幕上的导航栏与大屏幕上的导航栏显示相同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27736224/

相关文章:

javascript - 如果数量列的数值小于 10,如何更改表格行的背景颜色

javascript - 如何确保使用css和js的动态文本可以缩放和向上滑动?

javascript - ng-if 和 ng-show 无法切换表的可见性

css - 我的 CSS 中的某些东西使我使文本元素出现在其标签下方的一行

twitter-bootstrap - 使用 Bootstrap css 打印

每个都是可靠的 PHP 下拉菜单

javascript - 在图像上显示列表 : the text goes to the right of it

html - 线性渐变在 IE 11 中不起作用

javascript - Firefox 中的鼠标移动动画与过渡滞后

javascript - Bootstrap 卡片中的响应式 PlotlyJS 图表