我有以下的報頭,其中包括一個引導4瀏覽:引導4導航 - 移動視圖
<div class="header container-fluid">
<div class="row">
<div class="brand col-sm-10 offset-sm-1">
Logo
</div>
<nav class="navbar navbar-toggleable-md navbar-light bg-faded col-sm-10 offset-sm-1">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav mx-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Welcome<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown_angebot" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Pricing
</a>
<div class="dropdown-menu" aria-labelledby="dropdown_angebot">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown_unternehmen" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Our Company
</a>
<div class="dropdown-menu" aria-labelledby="dropdown_unternehmen">
<a class="dropdown-item" href="#">History</a>
<a class="dropdown-item" href="#">Career</a>
<a class="dropdown-item" href="#">Clients</a>
</div>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Get here<span class="sr-only">(current)</span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Contact<span class="sr-only">(current)</span></a>
</li>
</ul>
</div>
</nav>
</div>
</div>
我已經做出了一些改變,因爲我想導航項目爲中心,並延伸到非常行/列的開頭。但是,現在我的手機導航功能已經失效了,我不知道這是爲什麼。
這裏是上海社會科學院爲我導航:
.brand {
display: flex;
justify-content: center;
align-items: center;
height: 100px;
}
.navbar {
height: 50px;
background-color: white !important;
padding: 0 !important;
.navbar-nav {
display: table;
width: 100%;
list-style: none;
.nav-link {
padding: 0 !important;
}
li {
display: table-cell;
text-align: center;
a {
// background-color: yellow;
display: block;
}
}
li:first-child {
text-align: left;
}
li:last-child {
text-align: right;
}
.nav-item {
// margin: 30px;
}
}
}
這裏是一個的jsfiddle: https://fiddle.jshell.net/fmz6hafz/
現在一切是水平排列,也是在移動視圖。我如何恢復這個並獲得原始引導移動視圖回來?
可以請你創建小提琴https://fiddle.jshell.net – Omi
我編輯我的帖子! :) –