Bootstrap - 移动设备 Header 中的右对齐图标按钮
Bootstrap - Right Align Icon Buttons in Header on Mobile
我正在使用 Bootstrap 构建响应式网站。该网站有一个固定的导航栏。它在桌面上运行良好。但是,当站点在移动设备上 运行 时,右上角的图标会消失。我的代码如下所示:
<div id="nav" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="/home" class="navbar-brand"><img src="/logo.png"></a>
</div>
<div class="navbar-header navbar-right">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a id="viewButton" data-toggle="tooltip" data-placement="bottom"><span class="glyphicon glyphicon-print"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
<ul class="dropdown-menu" role="menu">
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
如何在移动视图中 right-align 导航栏中的按钮?
谢谢!
您可以尝试在此处删除折叠 class
<div class="navbar-collapse collapse">
您好,您必须从 div 中删除折叠 类。
http://www.bootply.com/F6jMrwYOQQ#
<div id="nav" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="/home" class="navbar-brand"><img src="/logo.png"></a>
</div>
<div class="navbar-header navbar-right">
<div class="navbar">
<ul class="nav navbar-nav navbar-right">
<li><a id="viewButton" data-toggle="tooltip" data-placement="bottom"><span class="glyphicon glyphicon-print"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
<ul class="dropdown-menu" role="menu">
</ul>
</li>
</ul>
</div>
</div>
</div>
我正在使用 Bootstrap 构建响应式网站。该网站有一个固定的导航栏。它在桌面上运行良好。但是,当站点在移动设备上 运行 时,右上角的图标会消失。我的代码如下所示:
<div id="nav" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="/home" class="navbar-brand"><img src="/logo.png"></a>
</div>
<div class="navbar-header navbar-right">
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a id="viewButton" data-toggle="tooltip" data-placement="bottom"><span class="glyphicon glyphicon-print"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
<ul class="dropdown-menu" role="menu">
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
如何在移动视图中 right-align 导航栏中的按钮?
谢谢!
您可以尝试在此处删除折叠 class
<div class="navbar-collapse collapse">
您好,您必须从 div 中删除折叠 类。 http://www.bootply.com/F6jMrwYOQQ#
<div id="nav" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a href="/home" class="navbar-brand"><img src="/logo.png"></a>
</div>
<div class="navbar-header navbar-right">
<div class="navbar">
<ul class="nav navbar-nav navbar-right">
<li><a id="viewButton" data-toggle="tooltip" data-placement="bottom"><span class="glyphicon glyphicon-print"></span></a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" aria-haspopup="true" aria-expanded="false">
<span class="glyphicon glyphicon-arrow-right"></span>
</a>
<ul class="dropdown-menu" role="menu">
</ul>
</li>
</ul>
</div>
</div>
</div>