试了下两种方式float和这个一浮动都得浮动而且还要设置margin值,这样的话本来就对称,所以设置margin也只用简单设置一下就可以了。但是为啥当初没有教呀
<style>
*{
margin: 0;
padding: 0;
}
header{
width: 1200px;
background-color: black;
display: flex;
}
.logo{
width: 20%;
display: flex;
justify-content: space-around;
align-items: center;
}
.nav{
width: 70%;
display: flex;
justify-content: space-around;
align-items: center;
color: white;
list-style: none;
font-size: 20px;
}
.login{
width: 10%;
display: flex;
justify-content: space-around;
align-items: center;
}
.login input{
color: white;
background-color: orange;
font-size: 20px;
border-radius: 5px;
}
</style>
<body>
<!-- <script>
console.log(window.innerWidth)
</script> -->
<a class="iconfont" href=""></a>
<a class="iconfont" href=""></a>
<a class="iconfont" href=""></a>
<div class="a">
<div class="a1"></div>
<div class="a2"></div>
<div class="a3"></div>
</div>
<header>
<div class="logo">
<img src="http://img1.sycdn.imooc.com/climg//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>
在这里输入代码,可通过选择【代码语言】突出显示
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星