:hover 下拉菜单 完全写在.css 文件里 怎么写???
如题: 我把:hover 写在.css 里,不会写了,ul li:hover ul{display:block;} 这一句,我就没改明白。 还是我这种写法不行?? <a href="#" class = "navUserInfo">Hello,yueguang_jin ▾<ul class = "navUlStyle"> <li class = "navLiStyle"><a href="#" class = "navLiStyleAstyle">diyihang</a></li> <li class = "navLiStyle"><a href="#" class = "navLiStyleAstyle">diyihang</a></li> <li class = "navLiStyle"><a href="#" class = "navLiStyleAstyle">diyihang</a></li> </ul> </a>
.navOrder{ text-decoration:none; font-family: "PingFang SC"; margin-right: 40px; margin-top: 15px; float: right; font-size: 13.993px; color: rgb( 135, 165, 179 ); display:block; } .navOrder:hover{color: red} .navUserInfo:hover .navUlStyle{display:block; color: red} .navUlStyle{ list-style-type: none; position: absolute; left: 100px; top: 200px; /*display:none;*/ width: 100px; height: 100px; background: yellow; } .navLiStyle{ float:none;margin-top:2px; background-color:#eee; } .navLiStyleAstyle{ text-decoration:none; padding: 0; margin: 0; cursor: pointer; /*鼠标悬停出小手*/ } .navLiStyleAstyle:hover{ color: yellow }/*鼠标悬停变色*/
ad s