老师帮忙看一下,有没有错误,哪里需要改进,辛苦了
来源:3-10 编程练习
小雨不大点
2021-06-25 23:06:30
相关代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*在此处补充代码*/
*{
margin: 0;
padding:0;
}
header{
display: flex;
justify-content: space-around;
align-items: center;
background-color: black;
font-size: 20px;
}
header .nav{
width:30%;
display: flex;
justify-content: space-around;
color: white;
list-style: none;
}
header .login{
width: 120px;
display: flex;
justify-content: space-around;
}
header .login input{
width: 45px;
background-color: #f7cb0b;
border-radius: 3px;
border: none;
font-size: 18px;
}
</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图片在盒子内没有垂直居中显示,建议优化一下,如图
建议:给logo盒子进行弹性布局,并设置垂直居中即可,参考代码如下:
祝学习愉快!
相似问题
回答 1
回答 1
回答 1
回答 1
回答 1