繁体   English   中英

为什么:hover在此CSS代码中不起作用?

[英]Why does :hover in this CSS code not work?

li.Log-In {
    margin-left: 20px;
    text-transform: uppercase;
}
li.Log-In:hover {
    margin-left: 20px;
    text-transform: uppercase;
    cursor: hand;
}

当我测试它时,当我将鼠标悬停在“登录”上方时,它不会将光标更改为手形

您无需添加:hover即可实现此目的。 而且手形光标的名称不是“手”,而是“指针”。尝试以下操作:

       li.Log-In {
        margin-left: 20px;
        text-transform: uppercase;
        cursor: pointer;
      }
 Try this fun thing with hover!! :)

<!DOCTYPE html>
 <head>
     <title>Hover</title>
 </head>

<style type="text/css">

 #box{
width: 10em;
height: 10em;
background: #666;
margin: 2em auto;
box-shadow: 0 .2em .4em rgba(0,0,0,0.3);
-webkit-transition:all ease-in .2s;
-o-transition:all ease-in .2s;
-moz-transition:all ease-in .2s;
-ms-transition:all ease-in .2s;
transition:all ease-in .2s;
cursor: pointer;
/*cursor: wait;*/
}

#box:hover{
border-radius: .5em;
background: #13a58e;
box-shadow: 0 .5em .3em rgba(0,0,0,0.5);
margin: .3em auto;
}

</style>

 <body>

 <div id="box"></div>

</body>

</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM