好得很程序员自学网

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

css如何将div实现全屏水平垂直居中_html/css_WEB-ITnose

css如何将div实现全屏水平垂直居中:
本章节介绍一下如何将一个div元素在整个网页内实现水平垂直居中效果,代码是最有说服力的,直接看代码。
代码如下:

           蚂蚁部落   body{   margin:0px;   padding:0px; } #thediv{  width:100px;  height:100px;  background:green;  position:absolute;  left:50%;  top:50%;  margin-left:-50px;  margin-top:-50px;}      

查看更多关于css如何将div实现全屏水平垂直居中_html/css_WEB-ITnose的详细内容...

  阅读:32次