标签:
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> #father{ width: 100%; height: 500px; background: lightcoral; writing-mode:vertical-lr; } #son{ background: lightblue; height: 200px; margin:auto; width: 200px; } </style> </head> <body> <div id="father"> <div id="son"> </div> </div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> <style type="text/css"> #father{ height: 500px; background: lightcoral; position: relative; } #son{ background: lightblue; position: absolute; top: 0; bottom: 0; left: 0; right: 0; width: 200px; height: 100px; margin: auto; } </style> </head> <body> <div id="father"> <div id="son"> </div> </div> </body> </html>
【writing-mode与absolute,auto】垂直居中
标签:
原文地址:http://www.cnblogs.com/yatao/p/5844890.html