Correcting teacher:天蓬老师
Correction status:qualified
Teacher's comments:写得很规范
flex-basis
flex-basis
的优先级要高于widthflex-grow
flex-shrink
flex
flex : flex-grow flex-shrink flex-basis
flex : 0 1 auto
(不扩展,允许收缩,默认宽度)flex : auto
等价于 flex : 1 1 auto
flex : initial
等价于 flex : 0 1 auto
flex : none
等价于 flex : 0 0 auto
flex : 2
等价于 flex : 1 1 auto
flex : 1
指当前项目可以自动伸展到所有的剩余空间align-self
flex-start
是默认值,还可以设置flex-end
order
注 : 注意引入css中的路径
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="../../../../static/font/iconfont.css">
<link rel="stylesheet" href="../../../static/css/_header.css">
</head>
<body>
<header>
<div class="header">
<div class="left">
<ul>
<li><a href="">网站首页</a></li>
<li><a href="">专题</a></li>
<li><a href="">网站导航</a></li>
<li><a href="">二手商品</a></li>
<li><a href="">讨论区</a></li>
</ul>
</div>
<div class="right">
<a href=""><i class="iconfont icon-huiyuan2"></i></a>
<a href="">登录</a>
<a href="">注册</a>
</div>
</div>
</header>
</body>
</html>
_header.css
@import "reset.css";
.header {
height: 50px;
background-color: #000000;
position: relative;
}
.header .left {
width: 400px;
margin-left: 30px;
}
.header .left > ul {
width: 400px;
height: 50px;
display: flex;
align-content: center;
justify-content: space-between;
}
.header .left > ul > li {
width: 50px;
height: 50px;
text-align: center;
line-height: 50px;
}
.header .left > ul > li > a {
display: inline-block;
width: 50px;
height: 50px;
color: #ffffff;
}
.header .left > ul > li > a:hover {
background-color: #fff;
color: #000;
}
.header .right {
margin-right: 30px;
position: absolute;
top: 0;
right: 0;
width: 100px;
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
}
.header .right a {
color: #ffffff;
}
reset.css
* {
padding: 0;
margin: 0;
}
a {
text-decoration: none;
}