i'm having a bad time trying to figure out how to align 3 divs vertically, inside another div. I want one div to be on the left, one on the right, and one aligned on the center. I'm using position relative, top 50% and transformY(-50%), to align everything vertically. When i tried this, they still stay one above another
i made this example on jsfiddle: https://jsfiddle.net/6jb4c5gz/8/
<section style="background-color: yellow">
<div class="aaa" style="background-color:red;"></div>
<div class="bbb" style="background-color:blue;"></div>
<div class="ccc" style="background-color:green;"></div>
</section>
css:
body {
padding: 0;
margin: 0;
}
header{
margin: 0 auto;
text-align: center;
}
div {
height: 30px;
width: 30px;
}
1 {
position: relative;
top: 50%;
transform: translateX(-50%);
}
can someone help me with this?
Edit: i think i wasn't really clear. I want the 3 divs to be in the same line, one on the left, one on the center, and one on the right, but aligned vertically