2013-08-17 48 views
0

enter image description here文字图像定位与css

如何将文字放在图像“这里”?
从包装开始它必须是20px,固定为250px。

HTML

<div class="background-image"> 
    <img src="img/picture.jpg" alt="pasta-town"> 
    <div id="motto" class="wrap"> 
     <div>some motto</div> 
    </div> 
</div> 

CSS

#motto { 
font-size: 26px; 
font-family: "MetaProMedium"; 
position: absolute; 
top:0; 
} 
#motto div { 
left: 755px; 
width: 250px; 
} 
.background-image { 
position: relative; 
width: 100%; 
} 
.background-image > img { 
width: 100%; 
} 
+0

如果您使用的图像意味着尝试html图像映射选项。 –

+2

“这里”框的父母是什么? 'td'? 'div'?或者是什么? – mshsayem

回答

0

您将需要调整的z-index两个包含图像div和要POSI较高Z文本-index将覆盖较低的一个。

+0

不需要z-index。它显示正确 –