我有一个CSS条目,如下所示:
.header { background-image: url("./images/embouchure.jpg"); background-repeat: no-repeat; height:160px; padding-left:280px; padding-top:50px; width:470px; color: #eaeaea; border-bottom:1px solid #eaeaea; }
解决方法
尝试将锚定标签包裹在锚标签中并应用背景图像.
HTML:
<div class="header"> <a href="/"> <span class="header-title">My gray sea design</span><br /> <span class="header-title-two">A beautiful design</span> </a> </div>
CSS:
.header { border-bottom:1px solid #eaeaea; } .header a { display: block; background-image: url("./images/embouchure.jpg"); background-repeat: no-repeat; height:160px; padding-left:280px; padding-top:50px; width:470px; color: #eaeaea; }