老师代码对吗
来源:3-10 编程练习
情分的小前端
2021-03-22 18:59:20
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
}
header {
height: 80px;
width: 100%;
background-color: black;
display: flex;
align-items: center;
justify-content: space-around;
}
.logo {
width: 191px;
}
.logo img {
height: 57px;
}
.nav {
width: 400px;
display: flex;
justify-content: space-around;
align-items: center;
}
.nav li {
width: 100px;
color: white;
font-size: 20px;
}
.login {
width: 180px;
display: flex;
justify-content: space-around;
align-items: center;
}
.login input {
width: 50px;
height: 25px;
background-color: orange;
color: white;
border: none;
outline: none;
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回答
好帮手慕久久
2021-03-22
同学你好,代码中有如下问题:
1、导航项文字在ul中没有居中显示:
原因是li设置了固定宽度,而文字默认居左显示,建议将宽度去除:
2、右侧按钮,缺少圆角效果:
建议添加上:
祝学习愉快!
相似问题