快捷导航
发新帖
返回列表
2 443
电梯直达  跳转到指定楼层

[提问] hover 不起作用

朱文强jude|中级会员 |勤币 132 |学币 0
发表于 2017-8-15 21:27 | 复制链接 | 打印 | 上一主题 | 下一主题

<!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>


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
举报 使用道具
| 回复

共2个回复 最后回复于 2017-8-19 08:23

勤币 614   学币 0  
沙发
发表于 2017-8-17 17:33:51 | 只看该作者
写法不对 .box1 .box2 a hover

a与hover中间不是空格,是:
.box1 .box2 a:hover
举报 使用道具
勤币 132   学币 0  
板凳
发表于 2017-8-19 08:23:37 | 只看该作者
太感谢了 纠结了好久终于解决啦 (*^▽^*)
举报 使用道具
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表