我想通过图像添加两个标题,周围的Googling我能够做的编码后,但它仅适用于一个标题DIV,当我添加第二字幕DIV,它消失..如何添加另一个标题div到图像?
我的代码:
<style>
.background_image
{
background:url(1.jpg);
width:420px;
height:205px;
border:1px solid #FFFF00;
overflow:hidden;
}
.text_caption
{
padding-left:2px;
padding-top:0px;
padding-right:2px;
padding-bottom:2px;
color:#fffff;
font-size:30px;
font-weight:bold;
font-family:Trebuchet MS;
text-decoration:none;
margin-left:5px;
margin-top:140px;
}
.text_caption2
{
padding-left:4px;
padding-top:0px;
padding-right:4px;
padding-bottom:0px;
color:#000000;
font-size:26px;
font-weight:bold;
font-family:Trebuchet MS;
text-decoration:none;
margin-left:5px;
margin-top:150px;
}
</style>
<div class="background_image">
<div class="text_caption">Caption 1</div> /* this works */
<div class="text_caption2">Caption 2</div> /* this caption disappears */
</div>
对此有何帮助?我的代码有什么问题?
是的,现在我知道了,现在两个字幕都有固定位置,现在不会去这里和那里..谢谢你的回答和时间,Ragnarokkr 。 :) –
很高兴有帮助。别客气 :) – Ragnarokkr