画像内にテキストを配置しようとしていますが、テキスト div が画像の上に表示されず、画像のすぐ下に隠れて見えなくなります。前もって感謝します!
jsfiddle へのリンクは次のとおりです: http://jsfiddle.net/XrXZj/1/
私のcssファイルに次のものがあります:
.spotlight {
color:#FFFFFF;
display:table;
height:120px;
margin-bottom:15px;
margin-left:0px;
overflow:hidden;
padding:0 50px;
position:relative;
width:840px;
}
.spotlight .wrapper {
position:absolute;
}
.spotlight .middle {
display:table-cell;
height:50px;
vertical-align:middle;
}
.spotlight .spotlight-copy {
font-size:15px;
line-height:25px;
width:500px;
}
htmlファイルの内容は次のとおりです。
<div class="spotlight">
<img src="<spring:url value="/assets/img/banner-natural-hazard-risk.jpg"/>" border="0" />
<div class="wrapper">
<div class="middle">
<div class="spotlight-copy">
<spring:message code="content.location.title" />
</div>
</div>
</div>
<div style="clear: both;"></div>
</div>