0
問題:自舉中的.nav
和.jumbotron
之間的間隔。無法覆蓋nav和jumbotron之間的邊距
我做了什麼:覆蓋bootstrap.css,覆蓋.jumbotron{margin-bottom:0px}
,它不工作。
我發現:當我在原始文件中進行調試時,它運行良好。
couldn't work in override css file
HTML:
<body>
<div class="header">
<div class="top-header">
<div class="jumbotron">
<img src="image/name.png" alt="">
<h2>Curiosity Creative</h2>
</div><!--Jumbotron-->
</div><!--top-header-->
<nav class="navbar navbar-default">
<div class="container">
<!-- 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="#displayItem" 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><!--navbar-header-->
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="displayItem">
<ul class="nav nav-tabs">
<li class="home active">
<a href="index.html"><i></i> Home</a></li>
<li class="me">
<a href="aboutMe.html"><i></i>AboutMe</a></li>
<li class="blog">
<a href="Blog.html"><i></i>Blog</a></li>
<li class="contact">
<a href="Contact.html"><i></i>Contact</a></li>
</ul>
</div> <!-- collapse navbar-collapse-->
</div><!--container -->
</nav><!--nav-->
</div>
CSS:
*{
margin: 0;
padding: 0;
}
body{
background: url("../image/body_bg.jpg");
overflow: scroll;
}
div{
position:relative;
}
.top-header{
background-color: white;
}
.jumbotron {
background-color:transparent !important;
text-align: center;
margin-bottom:0px;
}
.jumbotron img{
width: 400px;
}
.jumbotron h2{
color: #aaa;
font-size: 13px;
font-family: verdana;
}
嗨,大家好,有誰告訴我爲什麼它不能工作,如果我重寫它。 SOS ..... – 4CODE
也許這可以幫助你:http://stackoverflow.com/questions/20727020/remove-padding-in-jumbotron-bootstrap-3 –
當你增加重寫'.jumbotron '規則?例如:'.top-header .jumbotron {margin-bottom:0px;}' –