“position: absolute” 与 flexbox 有冲突吗?
绝对定位不会与 flex 容器冲突。同时需要设置父级的宽度和值
.parent { display: flex; justify-content: center; position: absolute; width:100% }
以下是 HTML
<div class = "parent"> <div class = "child">text</div> </div>
广告
绝对定位不会与 flex 容器冲突。同时需要设置父级的宽度和值
.parent { display: flex; justify-content: center; position: absolute; width:100% }
以下是 HTML
<div class = "parent"> <div class = "child">text</div> </div>