请参见此处的js fiddlehttp://jsfiddle.net/Ws8ux/
是否可以使用“显示:无”或“文本缩进”将文本保留在徽标下而不隐藏?我想把这张照片拿出来,把商标放在后面。就像是PSD层。不想使用徽标图像作为CSS background
<a href="/" title="Return to the homepage" id="logo">
<img src="http://lorempixum.com/100/100" alt="Nike logo" />Logo Text
</a>
最佳答案
喜欢
HTML。
<a href="/" title="Return to the homepage" id="logo">
<img src="http://lorempixum.com/100/100" alt="Nike logo" /><span>Logo Text</span>
</a>
CSS。
a { display: block; position: relative; }
a span {
display: block;
position: absolute;
top: 40%;
}