HTML - Flex -grow
- flex-grow 1 -> 남은여백을 1의 비율로 나누어 가지는것. (여백을 배수로 나누어 가지기)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="layout.css" type="text/css" rel ="stylesheet">
</head>
<body>
<section class = "s1">
<h1>flex box</h1>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ul>
</section>
</body>
</html>
@import url(css/reset.css);
.s1 ul {
display: flex;
flex-direction: row;
background: gray;
}
.s1 li{
flex-basis: 100px;
flex-grow:1;
}
.s1 li:nth-child(1){
background: red;
}
.s1 li:nth-child(2){
background: green;
}
.s1 li:nth-child(3){
background: blue;
}
.s1 li:nth-child(4){
background: yellow;
}
.s1 li:nth-child(5){
background: lightskyblue;
}
댓글남기기