我有一个带有<p>
标签内文本的 div 和一个 PNG 图像。我希望图像位于 div 的左侧,文本重叠。我曾尝试使用 z-index,但收效甚微。
HTML 代码:
<div class="caption">
<img src="images/stain.png" id="stain">
<p>The BA New Media course which I am studying is run by the Institute of Comminications Studies (ICS) at The University of Leeds. The Institute of Communications Studies is an internationally renowned centre for teaching and research in communications, media and culture. Their research is multidisciplinary and has particular strengths in the areas of cultural industries, international communication and political communication. <a href="http://ics.leeds.ac.uk/about/" target="_blank"><strong class="more">Read More...</strong></a>
</div>
CSS 代码:
.caption {
width:80%;
display:block;
margin:auto;
margin-top:5%;
z-index:5;
}
#stain {
z-index:1;
}