好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

css3实现元素水平垂直居中_html/css_WEB-ITnose

css3实现元素水平垂直居中,代码如下:


     无标题文档  html,body{    width:100%;    height:100%;    display: -webkit-box;    -webkit-box-orient: horizontal;    -webkit-box-pack: center;    -webkit-box-align: center;    display: -moz-box;    -moz-box-orient: horizontal;    -moz-box-pack: center;    -moz-box-align: center;    display: -o-box;    -o-box-orient: horizontal;    -o-box-pack: center;    -o-box-align: center;    display: -ms-box;    -ms-box-orient: horizontal;    -ms-box-pack: center;    -ms-box-align: center;    display: box;box-orient: horizontal;    box-pack: center;    box-align: center;}.main{    width: 300px;    height: 200px;    padding: 10px;    border: 1px solid #ccc;    margin: 20px auto;    display: -webkit-box;    -webkit-box-orient: horizontal;    -webkit-box-pack: center;    -webkit-box-align: center;    display: -moz-box;    -moz-box-orient: horizontal;    -moz-box-pack: center;    -moz-box-align: center;    display: -o-box;    -o-box-orient: horizontal;    -o-box-pack: center;    -o-box-align: center;    display: -ms-box;    -ms-box-orient: horizontal;    -ms-box-pack: center;    -ms-box-align: center;    display: box;    box-orient: horizontal;    box-pack: center;    box-align: center; }.main img{    width:70%;    height: 70%;}       

查看更多关于css3实现元素水平垂直居中_html/css_WEB-ITnose的详细内容...

  阅读:29次