您正在我的导航栏上工作。当我点击并打开表单输入上方和下方的菜单时导航栏处于移动视图中时,看起来像border-bottom
喜欢这里
我无法找到隐藏这两行。
问题在移动设备视图中,如何删除/禁用 上面和下面的边界底部形成输入
Codepen Example
body {
background: url('../images/bg.png');
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
}
hr {
border-top: 10px solid #444444;
position: fixed;
}
.navbar-left {
border-bottom: 0;
border-top: 0;
}
.navbar-form {
border-bottom: 0;
border-top: 0;
}
.page-wrapper {
margin-top: 40px;
}
@media (min-width: 768px) {
.custom-nav .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
min-width: 150px;
}
}
.custom-nav {
margin-bottom: 0;
background: #333333;
border: none;
border-radius: 0;
}
.custom-nav .navbar-brand {
color: #FFFFFF;
}
.custom-nav .navbar-brand:hover {
color: #FFFFFF;
}
.custom-nav .navbar-nav > .active > a,
.custom-nav .navbar-nav > .active > a:hover,
.custom-nav .navbar-nav > .active > a:focus {
background: none;
color: #ffffff;
}
.custom-nav .navbar-nav > li > a {
color: #ffffff;
font-size: 14.5px;
text-align: center;
}
.custom-nav .navbar-nav > li > a.home {
border-top: 2px solid #AC3931;
}
.custom-nav .navbar-nav > li > a.home:hover,
.custom-nav .navbar-nav > li > a.home:focus {
background-color: #AC3931;
}
.custom-nav .navbar-nav > li > a.forum {
border-top: 2px solid #F6AE2D;
}
.custom-nav .navbar-nav > li > a.forum:hover,
.custom-nav .navbar-nav > li > a.forum:focus {
background-color: #F6AE2D;
}
.custom-nav .navbar-nav > li > a.blog {
border-top: 2px solid #3B910D;
}
.custom-nav .navbar-nav > li > a.blog:hover,
.custom-nav .navbar-nav > li > a.blog:focus {
background-color: #3B910D;
}
.custom-nav .navbar-nav > li > a.codeigniter {
border-top: 2px solid #2868B7;
}
.custom-nav .navbar-nav > li > a.codeigniter:hover,
.custom-nav .navbar-nav > li > a.codeigniter:focus {
background-color: #2868B7;
}
@media only screen and (min-width: 1040px) {
.custom-nav .navbar-collapse {
padding-left: 0;
padding-right: 0;
}
}
@media only screen and (max-width: 1040px) {
.custom-nav .navbar-collapse .navbar-nav > li > a {
text-align: left;
}
.custom-nav .navbar-collapse .navbar-nav > li > a.home {
border-top: none;
border-left: 2px solid #AC3931;
}
.custom-nav .navbar-collapse .navbar-nav > li > a.forum {
border-top: none;
border-left: 2px solid #F6AE2D;
}
.custom-nav .navbar-collapse .navbar-nav > li > a.blog {
border-top: none;
border-left: 2px solid #3B910D;
}
.custom-nav .navbar-collapse .navbar-nav > li > a.codeigniter {
border-top: none;
border-left: 2px solid #2868B7;
}
}
.page {
background: #EEEEEE;
/*box-shadow: 6px 6px 0px #989898, 12px 12px 0px #6B6666;*/
min-height: 500px;
padding: 20px;
}
.module {
background: #fff;
padding: 20px;
margin-bottom: 40px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}
.module .module-info {
color: #999;
font-size: 0.8em;
letter-spacing: 0.2em;
text-transform: uppercase;
font-family: 'source code pro';
}
.module .module-title {
font-size: 2.2em;
color: #000;
font-weight: bold;
display: block;
margin-bottom: 10px;
}
HTML
<div class="container">
<nav class="navbar navbar-inverse custom-nav">
<!-- 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>
</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 ><a class="home" href="#">Home</a></li>
<li><a class="forum" href="#">Forum</a></li>
<li><a class="blog" href="#">Blog</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle codeigniter" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">CodeIgniter <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>
<form class="navbar-form navbar-right">
<span class="fa fa-search"></span>
<input type="text" class="form-control" placeholder="Search">
</form>
</div><!-- /.navbar-collapse -->
</nav>
</div><!-- /.container-->
答案 0 :(得分:1)
将 box-shadow: none;
添加到 <form class="navbar-form navbar-right">
,问题就会解决。
<强>代码:强>
form.navbar-form.navbar-right {
box-shadow: none;
}
Codepen:→here。
答案 1 :(得分:0)
感谢每一个解决方案
当我刚刚在它上面添加了box shadow时,它仍然显示行但是更暗
因为我不得不添加
border-top 0
和border-bottom 0
并且有效
.navbar-form {
box-shadow: none;
border-top: 0;
border-bottom: 0;
}
解决了问题。
答案 2 :(得分:0)
尝试以下代码
@media (max-width: 768px){
.navbar-form{
-webkit-box-shadow:none;
box-shadow:none;
}
}