我試圖在與CSS和HTML下方的圖像寫入文本,但它不工作..如何將文字圖像
CSS
.social_media_head{
background: url(newsletter_image.gif) no-repeat center;
position: relative;
right: -9px;
height: 0;
width: 325px;
padding: 30px 0 0 5px;
}
.media_name h2{
position: relative;
top: 2px;
}
.media_name {
position: relative;
top: 2px;
}
HTML
上<div class="social_media_head">
<h2 class="media_name">Social Media</h2>
</div>
更新 如果我指的圖像是錯誤的,我非常抱歉。我想要放置文字的圖像是社交媒體圖標(臉譜,推特,YouTube)上的圖像......即,裏面的圖像=「social_media_head」。
我再次對此抱歉抱歉。
文字在圖像上方。至少當我看到它。 –
http:// jsfiddle。淨/ fCUTm /你需要改變填充邊距,並設置高度圖像的高度 –