老师 ,请帮忙检查一下,谢谢
来源:2-2 编程练习
慕神8387157
2019-05-08 16:14:13
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>header</title>
<link rel="stylesheet" href="css/headern.css">
</head>
<body>
<header>
<div class="container">
<div class="logo">
<a href="#"><img src="http://climg.mukewang.com/582e5f160001b17100400040.png"></a>
<a href="#"><span>MYMOOC</span></a>
</div>
<nav>
<a href="#" class="home">Home</a>
<a href="#">Course</a>
<a href="#">Actual</a>
<a href="#">Plan</a>
<a href="#">FAQ</a>
<a href="#">Notes</a>
</nav>
</div>
</header>
</body>
</html>
*{
margin: 0;
padding: 0;
font-family: Arial;
}
header > .container > nav:after,
header > .container:after{
content: ".";
height: 0;
visibility: hidden;
display: block;
clear: both;
}
a{
text-decoration: none;
}
header{
width: 100%;
height: 80px;
background: #000;
}
header > .container{
width: 1000px;
height: 80px;
margin: 0 auto;
}
header > .container > .logo{
width: 170px;
height: 80px;
float: left;
}
header > .container > .logo > a > img{
margin-top: 20px;
margin-left: 5px;
}
header > .container > .logo > a > span{
margin-left: 5px;
font-size: 24px;
color: #fff;
}
header > .container > nav{
float: right;
width: 500px;
height: 80px;
}
header > .container > nav > a{
display: block;
width: 80px;
height: 73px;
float: left;
color: #fff;
text-align: center;
line-height: 73px;
}
header > .container > nav > .home,
header > .container > nav > a:hover{
padding-bottom: 7px;
}
header > .container > nav > a:nth-child(1){
background: #017fcb;
}
header > .container > nav > a:nth-child(2){
background: #78b917;
}
header > .container > nav > a:nth-child(3){
background: #feb800;
}
header > .container > nav > a:nth-child(4){
background: #f27c01;
}
header > .container > nav > a:nth-child(5){
background: #d40112;
}
header > .container > nav > a:nth-child(6){
background: #433b90;
}
1回答
好帮手慕码
2019-05-08
同学你好!
代码效果实现的很好哦~
祝学习愉快,望采纳~
相似问题