It's my first time using flex-box. I am following a tutorial where this very example works.
I have 3 colo(u)red divs, side by side as is the default for flex-box, apparently.
When I add flex-direction: column; to the container of the divs, they no longer display (for me, although they do in the tutorial video).
I have prepared a Plunker. Just uncomment /*flex-direction: column;*/ to see my problem; here's the full code too.
Any idea what I'm doing wrong?
index.html <!doctype html>
<html>
<head>
<link rel="stylesheet" href="lib/style.css">
<script src="lib/script.js"></script>
</head>
<body>
<h1>Hello Plunker!</h1>
<section id="container">
<div id="child_1" class="child"></div>
<div id="child_2" class="child"></div>
<div id="child_3" class="child"></div>
</section>
</body>
</html>
style.css
#container{
display: flex; /* use flex-box */
width: 100%;
/*flex-direction: column;*/
}
.child{
/*width: 200px;*/
height: 200px;
width: 100px;
flex: 1; /* all available width (will be shared) */
}
#child_1{
/*height: 150px;*/
width: 100px;
background-color: red;
flex: 2; /* twice as wide as the others */
}
#child_2{
background-color: yellow;
}
#child_3{
background-color: blueviolet;
}