注册 登录
编程论坛 WEB前端(UI)

关于css 链接

浅暗花璃 发布于 2016-05-22 21:52, 4957 次点击
为什么点击链接,鼠标没反应呢
3 回复
#2
aspic2016-05-23 13:58
猜不出来。。。
要不你把代码发出来看看?
#3
浅暗花璃2016-05-23 18:27
.baner ul{
            /*position: relative;*/
            list-style: none;
            margin:0px;
            margin-left: 0px;
            padding: 0px;
            background-color: #54AD0A;
            width: 540px;
            height: 30px;
            z-index: 5;
            text-align: center;

        }
        .baner li{
            float: left;
            /*margin: 2px;*/
            text-align: center;
            list-style-position: inside;
        }
        .baner a:link,a:visited{
            /*position: absolute;*/
            /*left: 380px;*/
            /*top: 20px;*/
            display: block;
            text-decoration: none;
            color: white;
            font-style: normal;
            font-size:12px;
            margin: 2px;
            padding: 2px;
             cursor: pointer;
             pointer-events: none;
             z-index: 999999;

        }
        .baner a:hover{
            font-size:14px;
        }
前面是css代码,下面是html
<div class="baner">
        <img src="01/images/logo.jpg">
        <ul>
<li>
<a href="#">网站首页</a>
</li>
<li>
<a href="#">公司新闻</a>
</li>
<li>
<a href="#">行业动态</a>
</li>
<li>
<a href="#">基地管理</a>
</li>
<li>
<a href="#">会员服务</a>
</li>
<li>
<a href="#">网上购物</a>
</li>
<li>
<a href="#">产品展示</a>
</li>
<li>
<a href="#">关于我们</a>
</li>
<li>
<a href="#">ewglish</a>
</li>
</ul>   
</div>


[此贴子已经被作者于2016-5-23 18:29编辑过]

#4
小赵q12016-05-26 00:08
点击链接没有反应的原因是,你的css样式的红色部分屏蔽了a标签的事件(可能是所有事件也可能只是屏蔽了点击事件),去掉那一行就可以了。
.baner a:link,a:visited{
            /*position: absolute;*/
            /*left: 380px;*/
            /*top: 20px;*/
            display: block;
            text-decoration: none;
            color: white;
            font-style: normal;
            font-size:12px;
            margin: 2px;
            padding: 2px;
             cursor: pointer;
             pointer-events: none;
             z-index: 999999;

        }
        .baner a:hover{
            font-size:14px;
        }
前面是css代码,下面是html
<div class="baner">
        <img src="01/images/logo.jpg">
        <ul>
<li>
<a href="#">网站首页</a>
</li>
1