浏览代码

05-flex

05-flex
emieldkr 4 年前
父节点
当前提交
763677b2d1
共有 2 个文件被更改,包括 72 次插入0 次删除
  1. 49
    0
      05-flex/flex.css
  2. 23
    0
      05-flex/flex.html

+ 49
- 0
05-flex/flex.css 查看文件

@@ -0,0 +1,49 @@
.container{
background-color: bisque;
padding: 10px;
display: flex;
/* flex-direction: row;
flex-wrap: nowrap; */
height: 500px;
flex-flow: row nowrap;
justify-content: flex-start;
align-items: stretch;
/* align-content: stretch; only works on multiple lines */
}

.container div {
line-height: 40px;
font-size: 20px;
color: white;
text-align: center;
}

.div-1{
background-color: chocolate;
/* flex-grow: 1; */
/* flex-shrink: 0; */
flex: 2 0 200px;
order: 2;
}
.div-2{
background-color: darksalmon;
flex: 1 1 100px;
order: 1;
}
.div-3{
background-color: lime;
flex: 1 1 100px;
order: 5;
}
.div-4
{
background-color: thistle;
flex: 1 1 100px;
order: 3;
}
.div-5
{
background-color: rebeccapurple;
flex: 1 1 100px;
order: 10;
}

+ 23
- 0
05-flex/flex.html 查看文件

@@ -0,0 +1,23 @@
<!DOCTYPE html>

<html>

<head>
<meta charset="utf-8" />
<title>Flex</title>
<link rel="stylesheet" href="flex.css">

</head>

<body>
<div class="container">
<div class="div-1">1</div>
<div class="div-2">2</div>
<div class="div-3">3</div>
<div class="div-4">4</div>
<div class="div-5">5</div>

</div>
</body>

</html>

正在加载...
取消
保存