flexbox常用布局左右固定,中间自适应

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title></title>
  <style>
ul{
  display:flex;
}
li:first-child,
li:last-child{
  width:50px;
  background-color: green;
}
li:nth-child(2){
  flex:1;
  background-color: yellow;
}
  </style>
</head>
<body>
<ul>
  <li>1</li>
  <li>2</li>
  <li>3</li>

</ul>
</body>
</html>
posted @ 2017-08-03 11:15  wmui  阅读(379)  评论(0编辑  收藏  举报