老师还可以优化吗
来源:3-13 编程练习
圈圈不是圆圆的圈
2019-06-20 08:43:54
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*在此处补充代码*/
* {
margin: 0;
padding: 0;
}
ul li {
list-style: none;
display: inline-block;
}
.logo,
.nav,
.login {
display: flex;
justify-content: space-between;
}
header {
display: flex;
width: 100%;
justify-content: space-around;
align-items: center;
background: #000;
}
.nav {
width: 30%;
}
.nav li {
font-size: 22px;
color: #fff;
}
.login {
width: 6%;
}
.login input {
display: inline-block;
width: 36px;
height: 24px;
;
background-color: orange;
border: none;
color: #fff;
}
</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回答
同学你好,li标签可以不设置display: inline-block;因为父级设置了弹性盒模型,元素会在一行显示。
祝学习愉快
相似问题