Layout with Flexbox: advanced CSS.
Let’s look at flexbox components:
Let’s write the code to start playing with it.
<!DOCTYPE html>
<html>
<head>
<style>
.container {
background-color: blue;
margin: 10px;
}
.container-item {
background-color: yellow;
color: blue;
text-align: center;
margin: 10px;
width: 70px;
}
</style>
</head>
<body>
<div class="container">
<div class="container-item">A</div>
<div class="container-item">B</div>
<div class="container-item">C</div>
<div class="container-item">D</div>
<div class="container-item">E</div>
</div>
</body>
</html>
Now let’s give to our container the property display:flex;
. See what changes.