## dispaly属性
把盒子变的有弹性一共需要几步?
~~~
display:flex;
~~~
例子:
~~~
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin: 0;
padding: 0;
}
.flex-container {
display: flex;
padding: 30px;
background-color: purple;
}
.flex-item:nth-child(1) {
background-color: red;
}
.flex-item:nth-child(2) {
background-color: yellow;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">A</div>
<div class="flex-item">B</div>
</div>
<span>跟你挤一挤</span>
</body>
</html>
~~~
> display:inline-flex,父容器会自适应宽,不会占据一整行