The mobile end is centered vertically using the-webkit-box horizontal
Properties of the-webkit-box:
-webkit-box-orient (parent): Horizontal arranges child elements from left to right in horizontal rows; vertical arranges child elements vertically from top to bottom.
-webkit-box-pack (Parent): Start horizontal left-aligned, end horizontal right-aligned, center horizontal, justify justified.
-webkit-box-align (Parent): Start top align, end bottom aligned, center vertically centered, stretch stretched to parent container, etc.
-webkit-box-flex (Child): Used to divide a child container by a certain rule on the width of the parent container.
Code:
<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <title>Webkit-box</title> <style>. Father{Display:-webkit-box;-webkit-box-orient:Horizontal;-webkit-box-pack:Center;-webkit-box-align:Center;Background-color:#f4f4f4;Height:400px; }. Child1{Background-color:Red;Color:#f4f4f4;font-size:100px; }. Child2{Background-color:Yellow;Color:Green;font-size:200px; }. Child3{Background-color:Blue;Color:#f4f4f4;font-size:100px; } </style></Head><Body><Divclass= "Father"> <Divclass= "Child1">1</Div> <Divclass= "Child2">2</Div> <Divclass= "Child3">3</Div></Div></Body></HTML>
Effect:
Original address:
Http://www.cnblogs.com/mywaystrech/p/4849260.html
The mobile end is centered vertically using the-webkit-box horizontal