还有拿些地方要注意
来源:3-10 编程练习
福徐贵
2020-10-25 15:36:15
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
* {
margin: 0;
padding: 0;
}
header {
display: flex;
/* width: 100%; */
justify-content: space-around;
align-items: center;
height: 57px;
background: #000;
}
header .nav {
display: flex;
width: 550px;
justify-content: space-around;
align-items: center;
font-size: 20px;
color: #fff;
list-style-type: none;
}
header .login {
width: 100px;
display: flex;
justify-content: space-around;
}
input {
background: orange;
border: none;
}
</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、右侧两个按钮样式不美观,可以添加padding值,修改字体颜色以及添加圆角效果


祝学习愉快!
相似问题