<!DOCTYPE html> <html> <head> <title></title> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> <style> #box{ width: 100%; height: 100%; } #mar{ width: 300px; height: 300px; background-color: red; position: absolute; left: 0; right: 0; top:0; bottom: 0; margin: auto; } </style> </head> <body> <div id="box"> <div id="mar"></div> </div> </body> </html>
区块上下左右居中布局
最新推荐文章于 2024-04-12 11:37:26 发布