有的涉猎器默许div模式是居中的,有的是靠左的,对div设置内容居中是有重要的。
div形式程度居中代码: text-align:center
残缺的DIV水准居中和div内容程度居中示例代码:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>div居中小实例 CSS5</title> <style> .ct{ margin:0 auto; width:370px; border:1px solid #000; text-align:center} </style> </head> <body> <div class="ct">div居中症结配置margin:0 auto</div> </body> </html>
截图
DIV机关居中与模式居中示例
div内容居中关键代码:text-align:center
div在屏幕中居中枢纽代码:margin:0 auto
如需转载,请注明文章出处和来源网址:http://www.divcss5.com/css-jiaocheng/tc53633.shtml