需要的精灵图地址:https://s2.music.126.net/style/web2/img/frame/topbar.png?1fe3017650c478831bfff5457b733a45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
}
ul,li{
list-style: none;
margin: 0;
padding: 0;
}
.top{
height : 70px;
background-color: #242424;
margin : 0 auto;
box-sizing : border-box;
border-bottom : 1px solid red;
}
.top .topbar{
width: 1190px;
height: 69px;
display: flex;
justify-content: space-between;
margin: 0 auto;
line-height: 69px;
}
.topbar-left .logo{
width: 157px;
background-image: url(./images/topbar.png);
}
.topbar-left .logo a{
display: block;
text-indent: -9999px;
}
.topbar-left{
display: flex;
}
.topbar-left .topbar-left-list{
display: flex;
}
.topbar-left .topbar-left-list .item{
margin-left: 10px;
color: white;
padding: 0 10px;
}
.topbar-left-list .item1{
position: relative;
}
.topbar-left-list .item1::after{
content: "";
position: absolute;
width: 12px;
height: 7px;
background: url(./images/topbar.png) -226px 0;
top: 64px;
left: 50%;
}
.topbar-left-list .item:hover,
.topbar-left-list .item.active{
background-color: black;
}
.topbar-right{
display: flex;
margin-right: 10px;
align-items: center;
}
.topbar-right .item{
padding: 0 10px;
color: aliceblue;
}
.topbar-right .search{
width: 158px;
height: 32px;
background-color: white;
margin: auto 0;
border-radius: 10px;
}
.topbar-right .search span{
background-image: url(./images/topbar.png);
}
.topbar-right .author{
width: 90px;
height: 32px;
border: 1px solid white;
line-height: 32px;
border-radius: 10px;
margin: 0 10px;
text-align: center;
}
.topbar-right .author a{
color: #eee;
}
.topbar-right .author a:hover{
color: white;
}
.topbar-right .login a{
display: block;
color: #eee;
}
.topbar-right .login a:hover{
color: #eee;
}
.nav{
height: 35px;
line-height: 34px;
border: 1px solid red;
background-color: #c20c0c;
box-sizing: border-box;
}
.nav .nav-list{
margin: 0 auto;
width: 1033px;
padding-left: 180px;
display: flex;
}
.nav .nav-list a{
display: block;
font-size: 14px;
line-height: 14px;
color: aliceblue;
padding: 5px 13px;
border-radius: 10px;
margin: 3px 10px;
}
</style>
</head>
<body>
<div class="top">
<div class="topbar">
<div class="topbar-left">
<h1 class="logo">
<a href="#">网易云音乐</a>
</h1>
<ul class="topbar-left-list">
<li class="item item1 active">发现音乐</li>
<li class="item">我的音乐</li>
<li class="item">关注</li>
<li class="item">商城</li>
<li class="item">音乐人</li>
<li class="item">云推歌</li>
<li class="item">下载客户端</li>
</ul>
</div>
<div class="topbar-right">
<div class="item search"><span></span></div>
<div class="item author"><a href="#">创作者中心</a></div>
<div class="item login"><a href="#">登录</a></div>
</div>
</div>
</div>
<div class = "nav">
<ul class="nav-list">
<li><a href="#">发现音乐</a></li>
<li><a href="#">排行榜 </a></li>
<li><a href="#">歌单 </a></li>
<li><a href="#">主播电台</a></li>
<li><a href="#">歌手 </a></li>
<li><a href="#">新碟上架</a> </li>
</ul>
</div>
</body>
</html>