I have within a <div>
several elements <span>
, <button>
and <img>
aligned horizontally.
I need them to be centered vertically. They must be between them horizontally aligned and spaced occupying 100% of <div>
.
By making the browser window smaller, the first 3 elements must be aligned vertically and element 4 must remain horizontally aligned at 3
The code that I have focuses vertically on me but I can not get the elements to be placed equally in horizontal spacing. I also do not know how to make the first 3 elements to be placed vertically in case the browser window becomes smaller.
#container {
height: 100px;
width: 100%;
display: flex;
justify-content: center;
align-items; center;"
}
<div id="container">
<span class="t1">Elemento1</span>
<span class="t2">Elemento2</span>
<button class="b1">Elemento3</button>
<img class="i1">Elemento4</img>
</div>