HTML - Flex Direction / Basic
방향성에따라서 축방향에따라서 너비를 정하고싶을때는 flex-basic를 사용하면 된다.
ex) 사용의예
<!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:nth-child(1){
background: red;
flex-basis: 100px;
}
.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;
}
댓글남기기