This is a very simple exercise but I can't seem to find a neat way to solve it (just started learning about HTML and CSS).
I need the 5th block ("bloque 5") in red to be under the other four using Flexbox.
The result should be:
Could somebody help me with this, please? This is what I have so far:
div {
margin: 5px;
border: 1px solid pink;
padding: 5px;
font-family: arial, sans-serif;
font-size: 14px;
}
.contenidor {
width: 760px;
display: flex;
}
div[class*=element] {
width: 100%;
padding: 2px 30px 5px 2px;
}
.element5 {
background-color: red;
}
<div class="contenidor">
<div class="element1">bloque 1</div>
<div class="element2">bloque 2</div>
<div class="element3">bloque 3</div>
<div class="element4">bloque 4</div>
<div class="element5">bloque 5</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…