麻烦老师检查!
来源:3-10 编程练习
前端菜鸟HH
2020-09-27 17:46:53
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*在此处补充代码*/
*{
margin: 0;
padding: 0;
}
header{
width: 100%;
background: #000;
display: flex;
justify-content: space-between;
flex-flow: row nowrap;
align-items: center;
}
header div,
header ul{
margin: 0 50px;
}
header > ul.nav{
width: 500px;
list-style: none;
display: flex;
justify-content: space-between;
flex-flow: row nowrap;
}
header > ul.nav li{
color: #fff;
font-size: 16px;
}
header > ul.nav li:hover{
cursor: pointer;
}
header > div.login{
width: 100px;
display: flex;
justify-content: space-between;
flex-flow: row nowrap;
}
header > div.login input[type='button']{
background: orange;
border: none;
color: #fff;
font-size: 14px;
padding: 5px;
}
header > div.login input[type='button']:hover{
cursor: pointer;
}
</style>
</head>
<body>
<header>
<div class="logo">
<img src="http://climg.mukewang.com/59feb59700019dab01910057.png" alt="">
</div>
<ul class="nav">
<li>课程</li>
<li>路径</li>
<li>猿问</li>
<li>手记</li>
</ul>
<div class="login">
<input type="button" value="登录">
<input type="button" value="注册">
</div>
</header>
</body>
</html>
1回答
同学你好,代码布局是可以的,样式上还可以进行优化:
1、logo与父盒子之间有间隙

这是因为图片为行内元素,有文字特性,默认存在间隙。建议给图片设置为块元素

2、右侧按钮可以添加圆角效果,看起来美观一些


祝学习愉快!