div中的内容绝对居中(不适合IE6哦,IE6我已经不考虑了),直接看代码吧。 <!DOCTYPE HTML><html> <head> <title>绝对居中 </title> <style type=&q ...
div中的内容绝对居中(不适合IE6哦,IE6我已经不考虑了),直接看代码吧。
<!DOCTYPE HTML><html> <head> <title>绝对居中 </title> <style type="text/css"> h1, h2, h3, h4, h5 { margin:0px; padding:0px;}.panel { width:300px; height:150px; background:#000; color:green; display:table; float:left; margin-right:30px;}.absolute-center { vertical-align:middle; display:table-cell; text-align:center;} </style> </head> <body> <div class="panel"> <div class="absolute-center"> <h1>LPJT</h1> <h5>(龙破九天)</h5> </div></div><div class="panel"> <div class="absolute-center"> <h1>XAJT</h1> <h5>(笑傲九天)</h5> </div></div> </body></html>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:css div中内容绝对居中(多行内容)
关键词:CSS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。