<分区>
<分区>
我有以下生成 Logo 的代码, Logo 显示在正确的位置,但 a href=""
不起作用,为什么?
HTML:
<div class="banner">
<span><a href="<?php echo BASE_URL()?>link" title="View information about award"></a></span>
</div>
CSS:
div.banner{
width:592px;
height:1px;
position: fixed;
top:0;
right:0;
overflow: visible;
}
div.banner span{
display: block;
position: fixed;
top: 0;
right: 0;
background: url(../../../i/ribbon.png) top right no-repeat;
width: 197px;
height: 145px;
text-indent: -999em;
}
div.opens span a{
display:block;
width: 197px;
height: 145px;
}
最佳答案
您的链接类应该是 div.banner span a
而不是 div.opens span a
。因此您的链接没有文本,因此没有宽度,因为 CSS 规则不适用。所以没有什么可以点击的。
关于html - CSS 背景不可点击 - href =""不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15165352/