Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

why is flexbox affecting absolutely positioned element? [duplicate]

$
0
0

as it is said "an absolutely-positioned child of a flex container does not participate in flex layout.".then why are flexbox's justify-content:center and align-items: center properties making element centered?

<div class="parent"><div class="child"></div></div>
<style>  .parent{  height: 100px;  width: 100px;  background-color: red;  display: flex;  align-items: center;  justify-content: center;}.child{  position: absolute;  height:20px;  width: 20px; background-color: blue;}</style>

Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>