Home > Web Front-end > HTML Tutorial > Why does it have no effect when the mouse slides over the a in li? _html/css_WEB-ITnose

Why does it have no effect when the mouse slides over the a in li? _html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 11:46:19
Original
1260 people have browsed it

html code:

  • Information Code in css file:
    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;
    }


    Reply to discussion (solution)

    li.big:hover{
    Remove the spaces

    The spaces should not matter.
    li.big : hover{
    width:80px;
    height:30px;
    border-radius:8px;
    border:0;
    background:#ff9138;
    }
    Please try to modify this paragraph

    No. 1: The space between li.big: hover and a.chodet: hover must be removed before hover can take effect
    No. 2: You To make the hover of the a tag take effect, a.chodet:hover should be changed to a.cho:hover
    3rd: In order to implement an effect event (hover adds background and changes color), you use two events, resource efficiency Neither is optimal. It’s best to just add a hover to the a tag.

    Both a and hover must be added with display:block;.

    What a mess. . . Is it written according to standards?

    Add display:block to the a tag! ! !

    Thank you very much for taking the time to give me your enthusiastic answers! !

  • 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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template