Is it possible to horizontally center .div2
without position absolute/fixed
like this image?
div3 can change width
Here's my code:
body {
margin:0;
}
.test {
background:green;
color:#fff;
display:flex;
}
.test .div1 {
}
.test .div2 {
margin:0 auto;
background:red;
}
.test .div3 {
margin:0 0 0 auto;
}
<div class="test">
<div class="div1">Left options</div>
<div class="div2">Center div</div>
<div class="div3">Username: test (string can change)</div>
</div>