html - CSS 设置图形不可点击

标签 html css

为什么我不能点击我的图形?

HTML:

<div class="column-right-social">

    <ul>
        <li id="facebook"><a href="#"></a></li>
        <li id="twitter"><a href="http://www.twitter.com/"></a></li>
        <li id="mail"><a href="/contact-us"></a></li>
    </ul>

</div>

CSS:

.column-right-social ul{
    width:250px;
    margin:0px;
    padding:0px;

}

.column-right-social ul li{
    width:80px;
    height:80px;
    list-style-type:none;
    float:left;
}

.column-right-social #facebook{
    background:url('../image/facebook.png') no-repeat;

}

.column-right-social #twitter{
    background:url('../image/twitter.png') no-repeat;

}

.column-right-social #mail{
    background:url('../image/mail.png') no-repeat;

}

最佳答案

背景不可点击。你的<a>标签没有内容,因此浏览器会将它们呈现为 0x0(又名不可见)区域。您需要在 <a> 上设置一些高度/宽度元素也是如此。

关于html - CSS 设置图形不可点击,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7477251/

相关文章:

jQuery 附加到嵌套的 div 不滚动

javascript - 从 (line-break : normal) html

javascript - 删除新闻页面上的 "turn off adblock"广告包装

html - 在div中垂直对齐图像和文本

javascript - 单击时追加元素

html - 两个css伪类

javascript - Chrome : Dynamically created &lt;style&gt; tag does not have content?

javascript - 如何将 RGBA 背景放在图像或 div 区域上方?

javascript - 从中心将图像填充到 div 中

html - IE 7/8 中文本输入的文本缩进替代方案