1、如果是单行文本 。看代码:
Document #wrapper{ width: 500px; height: 500px; background: gray; } #wrapper p{ line-height: 500px;//行高=父级的height,垂直居中。 text-align: center;//水平居中 }
这是一段要垂直水平居中的文字!
查看更多关于css实现垂直居中_html/css_WEB-ITnose的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did109839