【发布时间】:2013-07-29 16:24:56
【问题描述】:
我正在尝试将图像放置在容器内的右侧。但是,在我将父容器设置为position: relative; 后,我的图像消失了。有任何想法吗?网址:http://andrewgu12.kodingen.com/。谢谢!
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 的绝对位置有关。
-
我将位置设置为绝对位置,这样它就会停留在页面底部,悬停在绿色块的正上方。