老师,这样 对吗?
来源:3-13 编程练习
Yuri沫
2020-01-28 16:21:50
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*在此处补充代码*/
*{
margin: 0;
padding: 0;
}
header{
background:#000;
color:#fff;
display:flex;
justify-content:space-around;
align-items:center;
width: 100%;
}
.nav{
list-style:none;
display:flex;
justify-content:space-between;
width: 400px;
}
.login{
display: flex;
justify-content:space-between;
width: 100px;
}
.login input{
background: orange;
color: #fff;
border: none;
border-radius: 5px;
padding: 5px;
}
</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回答
同学你好,整体布局以及实现效果是可以的。
优化:logo图片与父盒子之间存在间隙

这是因为图片为行内元素,有文字特性,默认存在间隙。可以设置图片为块元素,参考

相似问题