我試圖在容器內將圖像定位到右側。但是,在將我的父容器設置爲position: relative;
後,我的圖像消失了。有任何想法嗎?網站:http://andrewgu12.kodingen.com/。謝謝!div在位置後消失:相對
CSS:
.slide {
padding-top: 138px;
background-attachment: fixed;
width: 100%;
height: 100%;
position: relative;
box-shadow:inset 0px 10px 10px rgba(0,0,0,0.3);
}
div#inner-container {
text-align: left;
width: 960px;
margin: 0 auto;
padding: 0;
white-space: normal;
position: relative;
}
div#name {
right: 0;
bottom: 200px;
position: absolute;
}
HTML:
<div class="slide" id="home" data-slide="1" data-stellar-background-ratio="1">
<div id="inner-container">
<div id="name" clas="row">
<img src="images/names.png">
</div>
</div>
</div>
我認爲它與名稱div的絕對位置有關。 – nocturns2
我將該位置設置爲絕對位置,以便它停留在綠色塊正上方的頁面底部。 – Andrew