本章节介绍一下如何将一个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的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did110589