Sub-box is centered vertically with respect to the parent box Explanation

https://segmentfault.com/a/1190000016344599?utm_source=tag-newest
What is the role?
Several methods implemented strictly vertically centered
, which has several methods?
+ Margin 1.position
2.position + the Transform
3.flex
+ padding 4.box-Sizing

the three major problems to achieve sub-box vertically centered on parent-box
head is the son of two major upper-left corner to move 50% of the height of the father then get moving transform the height of his own son 50% by margin
third is centered directly employing elastic box model is the way of
less stringent then the third is more convenient
white-space property wrap

Published an original article · won praise 0 · Views 11

Guess you like

Origin blog.csdn.net/weixin_46013844/article/details/104116838
Recommended