`

CSS3 水平垂直居中

    博客分类:
  • CSS
 
阅读更多
Center the child elements of a div box by using the box-align and box-pack properties together:

div
{
width:350px;
height:100px;
border:1px solid black;

/* Internet Explorer 10 */
display:-ms-flexbox;
-ms-flex-pack:center;
-ms-flex-align:center;

/* Firefox */
display:-moz-box;
-moz-box-pack:center;
-moz-box-align:center;

/* Safari, Opera, and Chrome */
display:-webkit-box;
-webkit-box-pack:center;
-webkit-box-align:center;

/* W3C */
display:box;
box-pack:center;
box-align:center;
}

 From:http://www.w3schools.com/cssref/css3_pr_box-pack.asp

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics