I've got a #text
inside a flex #container
and want to absolutely position something underneath it :
How could it not be taken in the calculation for the flex positioning of is siblings ?
#container{
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
position: relative;
width: 95vw;
height: 95vh;
border: 1px solid black
}
#text{
font-size: 13px;
width: 50vw;
text-align: justify;
}
#absolute{
position: absolute;
bottom: 5px;
left: calc(47.5vw - 25px);
width: 50px;
text-align: center;
color: red;
}
<div id="container">
<div id="text">
"At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga."
</div>
<div id="absolute">
Absolutly
</div>
</div>
As you'll notice the #text
is slightly upside the center of is parent and I would like it perfectly vertically centered if possible without modifying :
The node tree
The already written flex properties (as
justify-content
in case of multiples.text
elements)
Edit :
I've found another question on this matter, tried the solution without results : Absolute positioned item in a flex container still gets considered as item in IE & Firefox
It seems to be relative a Firefox and IE bug (I'm currently running Firefox 47, it works on Chromium.)
Final Edit :
I pushed my research on the subject and found many questions related (duplicate) :
Absolute positioning interfering with flexbox positioning in Firefox
Absolutely positioned flex item not being removed from normal flow in Firefox
Answer by @Oriol Exclude element with fixed positioning from justify-content in flex layout
And a direct link to Bugzilla.