我無法將我的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>