- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 bootstrap 创建导航菜单。我希望基本导航在第二行,我想要一些杂项。快速链接挂出作为顶行。
在研究了几个示例并将它们组合在一起之后,我得到了一个似乎有效的解决方案(见下文),但有一个异常(exception)......
当我折叠菜单时,顶部栏很好地包裹了链接......根据需要,但是一旦我获得小型设备的汉堡菜单,我的第二个导航栏就会向上推并隐藏顶部导航栏元素。 Grr...我就是无法阻止这种行为。
我应该看哪里?
<nav class="navbar navbar-inverse navbar-fixed-top">
<div id="topBar">
<div class="container">
<div class="row">
<div class="col-md-3 col-xs-12" >
<ul class="top-links list-inline">
<li class="hidden-xs"><a href="@Url.Action("Index", "Contact")"><i class="fa fa-envelope"></i> CONTACT</a></li>
<li class="hidden-xs"><a target="_blank" href="https://get.teamviewer.com/xxxxx"><i class="fa fa-medkit"></i>Quick Support</a></li>
</ul>
</div>
<div class="col-md-9 col-xs-12">
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
</div>
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("xxxxxxx.Net", "Index", new { controller = "Home" }, new { @class = "navbar-brand" })
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-right">
... menu stuff here removed for simplicity
</ul>
</div>
<div class="navbar-header navbar-lower" role="navigation">
<div class="container">
<div class="collapse navbar-collapse collapse-buttons">
<ul class="nav navbar-nav navbar-right">
<li id="home">
@Html.ActionLink("Home2", "Index2", "Home")
</li>
<li id="about">
@Html.ActionLink("About", "Index", "About")
</li>
<li id="services">
@Html.ActionLink("Services", "Index", "Services")
</li>
<li id="contact">
@Html.ActionLink("Contact", "Index", "Contact")
</li>
<li id="portfolio" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Portfolio <b class="caret"></b></a>
<ul class="dropdown-menu">
<li id="1columnportfolio">
@Html.ActionLink("1 Column Portfolio", "OneColumn", "Portfolio")
</li>
<li id="2columnportfolio">
@Html.ActionLink("2 Column Portfolio", "TwoColumn", "Portfolio")
</li>
<li id="3columnportfolio">
@Html.ActionLink("3 Column Portfolio", "ThreeColumn", "Portfolio")
</li>
<li id="4columnportfolio">
@Html.ActionLink("4 Column Portfolio", "FourColumn", "Portfolio")
</li>
<li id="singleportfolioitem">
@Html.ActionLink("Single Portfolio Item", "SingleItem", "Portfolio")
</li>
</ul>
</li>
<li id="blog" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Blog <b class="caret"></b></a>
<ul class="dropdown-menu">
<li id="bloghome1">
@Html.ActionLink("Blog Home 1", "Home1", "Blog")
</li>
<li id="bloghome2">
@Html.ActionLink("Blog Home 2", "Home2", "Blog")
</li>
<li id="blogpost">
@Html.ActionLink("Blog Post", "Post", "Blog")
</li>
</ul>
</li>
<li id="other" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Other Pages <b class="caret"></b></a>
<ul class="dropdown-menu">
<li id="fullwidthpage">
@Html.ActionLink("Full Width Page", "FullWidth", "Other")
</li>
<li id="sidebarpage">
@Html.ActionLink("Sidebar Page", "Sidebar", "Other")
</li>
<li id="faq">
@Html.ActionLink("FAQ", "Faq", "Other")
</li>
<li id="404">
@Html.ActionLink("404", "FourOhFour", "Other")
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
最佳答案
如果没有别的,也许这会给你一些想法。您可以将这些链接放在 navbar-header
上方,以便与 navbar
的其余部分固定在一起,并且不会妨碍 collapse
功能.它确实需要一些小的 CSS,但可能是更简单的选择。希望对您有所帮助。
查看示例代码段和全页并减少您的浏览器。
body {
padding-top: 100px;
}
.nav.navbar-top > li {
display: inline-block;
margin: 0;
padding: 0;
}
.nav.navbar-top > li > a:hover,
.nav.navbar-top > li > a:focus {
background: none;
}
@media (max-width: 480px) {
.nav.navbar-top span {
display: none;
}
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="nav navbar-top">
<li class="navbar-text"> <a href="#" class="navbar-link"><i class="fa fa-envelope"></i> <span>CONTACT</span></a>
</li>
<li class="navbar-text"> <a href="#" class="navbar-link"><i class="fa fa-medkit"></i> <span>QUICK SUPPORT</span></a>
</li>
<li class="navbar-text pull-right"> <a href="#" class="navbar-link"><i class="fa fa-sign-in"></i> <span>LOGIN</span></a>
</li>
</div>
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Brand</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a>
</li>
<li><a href="#">Link</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a>
</li>
<li><a href="#">Another action</a>
</li>
<li><a href="#">Something else here</a>
</li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a>
</li>
<li role="separator" class="divider"></li>
<li><a href="#">One more separated link</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Link</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a>
</li>
<li><a href="#">Another action</a>
</li>
<li><a href="#">Something else here</a>
</li>
<li role="separator" class="divider"></li>
<li><a href="#">Separated link</a>
</li>
</ul>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<div class="container-fluid">
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has
survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing
software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a
galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets
containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,
and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in
the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem
Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker
including versions of Lorem Ipsum.
</p>
</div>
关于jquery - 两行导航栏汉堡菜单缩小第一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34934413/
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
我正在尝试创建一个可以像在 Excel 中一样放大和缩小的 QTableView。 此处提出了类似的问题:Zooming function on a QWidget 但是,我在 PyQt 而不是 C
如图所示。 我在 QScrollArea 中有 QWidget。QWidget 充当细胞图像和一些基于矢量的轮廓数据的渲染小部件。用户可以执行放大/缩小操作,简单地发生的是,它改变了 QPaint
双击 MKMapView 时:放大。 但是如何缩小呢? 最佳答案 总是使用两根手指来放大和缩小。在模拟器上,您需要按住选项键才能在模拟屏幕上显示“两根手指”(我认为这是 Alt 键,但我在 Mac 上
我有一些 javascript for {} 循环,我在整个项目中重复使用它们,它们都类似于: for (var i = 0; i < things.length; i++) { consol
我知道我可以使用C-x C- +进行放大/缩小,但这仅适用于当前文件。一旦我打开另一个文本,文本将恢复为默认值,一遍又一遍地做起来真的很累。如何保持当前emacs session 的全局缩放级别? 如
我对使用编译器工具自动化/简化 Angular 项目感兴趣,这可能适用于其他所有事情,但 Angular 注入(inject)和命名空间很尴尬,足以逃避编译器知识。执行此操作的最佳/专业方法是什么?
有没有办法在emacs上放大和缩小(动态改变字体大小,相当流畅)? 最佳答案 尝试 C-x C-+ 和 C-x C--;即 Control-x Control-减号/Control-再加上。 在一个组
我有一个Windows表单对象,其中包含3个对象,树 View ,richtextbox和tabcontrol。它们没有停靠在Windows窗体中,而是被 anchor 定(顶部+左侧)。 我已经编写
我想向 javascript-mode 添加功能,以便每当我在当前缓冲区上保存 Javascript 文件时,它都会在使用相对路径定义的目录中创建该文件的缩小文件,例如 ../foo 具有相同的文件名
这里有一些关于缩小.war文件的教程,甚至一些帖子。但是,最常见的技术(在Config.groovy中包含grails.war.resources = {})似乎对我不起作用。无论如何,grails会
如何使用 ScaleTransition缩小图像?我现在有这个,它只能放大。如果我误解了该方法,我不会,但我将其从 1 缩放到 0.8。由于某种原因,这种情况仍在扩大。 ScaleTransition
基本上,我想问ReplicaSets是否与CronJobs的suspend: "true"选项类似,但我愿意接受其他建议。 最佳答案 From the official Kubernetes doc
我想使用 boost::polygon 扩展/收缩带孔的多边形。所以澄清一点,我有一个单一的数据结构 boost::polygon::polygon_with_holes_data inPoly 其中
我有一个 map 列表: [%{~D[2019-02-11] => 7}, %{~D[2019-02-12] => 1}, %{~D[2019-02-15] => 1}] 我正在尝试将其变成一张大
我正在制作一个横幅,您可以使用jquery幻灯片功能缩放图像并且可以拖动图像。 除了一件事之外,它工作完美。当您使用图像下方的幻灯片放大图像时,效果非常好。您可以将图像拖动到您想要的位置。但当你想用幻
我们有一个 extjs 应用程序,其中我们布置的结构与 Sencha 推荐的结构不完全匹配。在我们的结构中,我们没有 app.js,但我们有一个 js,其中我们提到了自动加载和启动功能,示例如下以及文
我想在 Chrome/Firefox 中运行的应用程序是: 用 typescript 写 使用 React 使用 es 下一个功能(模块、导入等)编写 有一些导入是纯 js 文件 网页包 3 我可以在
我正在尝试像此处一样应用 Google map 的放大/缩小 - https://www.google.com/maps/@36.241201,-98.1261798,5.13z?hl=en我无法让它
我正在使用 Protractor ,需要缩小到 50%,我尝试了 StackOverflow 上发布的其他几个问题的解决方案,但没有任何效果。其中一些包括: browser.actions().key
我是一名优秀的程序员,十分优秀!