2014-06-19 33 views
0

我想在事業部的圖像的頂部中央添加文本「郵報」,但它旁邊添加到圖像:的DIV中添加文本頂部圖像

HTML:

<div id="Post"> 
    <span class="Post">Post 
     <img src="images/ask_post.png" /> 
    </span> 
</div> 

CSS:

#Post { 
    position:absolute; 
    background-image:url('../images/ask_post.png') no-repeat; 
    left:741px; 
    top:157px; 
} 
+0

使用的背景圖片不重複 – Sami

回答

0

首先刪除div元素的圖像,文本不會去對圖像的頂部,只有背景。其次,玩background properties,直到它看起來像你想要的。

我的猜測是,你需要調整background-sizebackground-position

<div id="Post"> 
    <span class="Post">Post</span> 
</span> 

看看background-size:cover;是你需要的。你可能也有調整的div heightwidth得到你想要的東西。

0

它看起來像你正在調用圖像兩次。一旦進入CSS並再次在div中。刪除