我无法将我的div边缘与边框贴到我的图片边缘。如何将我的div放到我的照片边缘?
在我将边框添加到第二个div之前,它完美地排列起来,但现在我添加了它,div边缘与图片之间存在间隙。
.headDiv {
position: relative;
width: 100%;
}
#heading {
font-family: fantasy;
font-size: 36;
position: absolute;
top: 25%;
left: 35%;
}
#navBarDiv {
height: 30px;
width: 100%;
background-color: limegreen;
margin-top: -4px;
border: 10px ridge gray;
}
<div class="headDiv">
<img id="imgBackgroud" src="http://vignette1.wikia.nocookie.net/unturned-bunker/images/4/4c/PEILEVEL.png/revision/latest?cb=82112" alt="background behing heading" height="200px" width="100%" />
<h1 id="heading">Etowah Unturned Server</h1>
</div>
<div id="navBarDiv">
</div>