为啥鼠标滑过li里的a没效果?_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:46:19
Original
1177 people have browsed it

html代码:

  • 信息

  • css文件里代码:
    li.big{
    float:none;
    font-weight:normal;
    padding:5px 20px 5px 20px;
    text-align:center;
    margin-left:50px;
    margin-top:20px;
    font-size:20px;
    }
    .cho{
    display:block;
    width:80px;
    height:30px;
    font-family:'SimHei';
    color:#2f2f2f;
    padding-top:5px;
    }
    a.chodet : hover{
    color:white;
    }
    li.big : hover{
    width:80px;
    height:30px;
    border-radius:8px;
    border:0;
    background:#ff9138;
    }


    回复讨论(解决方案)

    li.big:hover{
    空格去掉

    空格应该没有关系的。
    li.big : hover{
    width:80px;
    height:30px;
    border-radius:8px;
    border:0;
    background:#ff9138;
    }
    这一段,你试试修改

    第1:li.big : hover与a.chodet : hover两个中间的空格一定要去掉,hover才能生效
    第2:你要a标签的hover生效,a.chodet:hover应该改成a.cho:hover
    第3:你为了实现一个效果事件(hover加背景和改写颜色),但使用了两次事件,资源效率都不是最优化。最好只用一个hover加在a标签上

    a和hover都要加上display:block;才行,

    什么乱七八糟的。。。按标准写好吗?

    a标签要加个display:block吧!!!

    十分感谢大家抽出时间给我的热心解答!!

    source:php.cn
    Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!