论坛

标题: hover 不起作用 [打印本页]

作者: 朱文强jude    时间: 2017-8-15 21:27
标题: hover 不起作用
[attach]103111[/attach]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>导航条案例2</title>
<style type="text/css">
.box1 {
        width: 100%;
        height: 45px;
        background-color: #459df5;
        margin-top: 200px;
}
.box2 {
        width: 1000px;
        height: 45px;
        margin: auto;
        min-width: 1000px;
}

.box1 .box2 a {
        width: 160px;
        height: 45px;
        background-color:#459DF5;
        text-decoration: none;
        display: block;
        float: left;
        text-align: center;
        line-height: 45px;
        font-family: "微软雅黑";
        font-size: 20px;
        color: aliceblue

               
}
.box1 .box2 a hover{
        width: 160px;
        height: 45px;
        background-color:#114980;
        text-decoration: none;
        display: block;
        float: left;
        text-align: center;
        line-height: 45px;
        font-family: "微软雅黑";
        font-size: 20px;
        color: aliceblue

               
}

</style>
</head>

<body leftmargin="0" marginwidth="0">
<div class="box1">
  <div class="box2">
          <a href="https://y.qq.com/">QQ音乐</a>
          <a href="http://music.163.com/">网易云音乐</a>
          <a href="http://www.xiami.com//">虾米音乐</a>
          <a href="http://www.kuwo.cn/">酷我音乐</a>
          <a href="http://music.baidu.com/">百度音乐</a>
          <a href="https://www.taobao.com">音乐商城</a>
         
         
  </div>
</div>
</body>
</html>



作者: yuanxi52028    时间: 2017-8-17 17:33
写法不对 .box1 .box2 a hover

a与hover中间不是空格,是:
.box1 .box2 a:hover
作者: 朱文强jude    时间: 2017-8-19 08:23
太感谢了 纠结了好久终于解决啦 (*^▽^*)




欢迎光临 论坛 (http://bbs.qinxue.com/) Powered by Discuz! X3.1