nav中给a设置:hover不起作用,还有button背景图片显示不出来


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
<div class="header w">
    <div class="logo"><img src="images/logo.png" alt=""></div>
    <div class="nav">
        <ul>
            <li><a href="#">首页</a></li>
            <li><a href="#">课程</a></li>
            <li><a href="#">职业规划</a></li>
        </ul>
    </div>
    <div class="search">
        <input type="text" placeholder="请输入关键词">
            <button></button> 
     </div>
        <div class="user">
            <img src="/images/user.png" alt="">
            bkppjhhh
        </div>
    </div>
</div>
</body>
</html>
*{
    margin: 0;
    padding: 0;
}
.w{
    width: 1200px;
    margin: 0;
}
a{
   
    text-decoration: none;
}

li{
    list-style: none;
}
body{
    background-color: #f3f5f7;
}
.header{
    float: left;
    margin: 30px auto;
    width: 1200px;
    height: 42px;
   
}
.logo{
    float: left;
    width: 200px;
    height: 50px;
}
.nav{
    float: left;
    margin-left: 50px;
    height: 42px;
  
}
.nav ul li{
    float: left;
    margin-left: 15px;
    line-height: 42px;
}
.nva ul li a{
    display: block;
    height: 42px;
    padding: 0 10px;
    line-height: 42px;
    font-size: 18px;
    color: #050505;
}
.nva ul li a:hover{
    border-bottom: 2px solid #00a4ff;
    color: #00a4ff;
}

.search{
    float: left;
    margin-left: 60px;
    width: 415px;
    height: 42px;

}
.search input{
    float: left;
    padding-left: 15px;
    border: 1px solid #00a4ff;
    border-right: none;
    width: 348px;
    height: 42px;
    font-size: 14px;
    color: #bfbfbf;
}
.search button{
    display: block;
    float: left;
    border: 0px;
    width: 48px;
    height: 42px;
    background-repeat: no-repeat;
    background-color: transparent;
    background-image: url(/images/search.png);
}
.user{
    float: left;
    height: 42px;
}
.img{
    float: left;
    width: 40px;
    height: 42px;
}



1.a标签hover不显示的问题 class样式表中 class名写错了 应该是 .nav 你写成了 .nva
2.button不显示背景图片的问题:在css样式中添加一行样式 background-size: 100% 100%;

img

  1. hover不起作用
    解决办法: style.css: 43行和51行 .nva改成.nav
  2. button背景图片
    解决办法:81行下面加一行 background-size: cover;