NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
~~~ <title>Document</title> <style> /* margin-left:auto;margin-right:auto; 仅仅针对块元素有效 */ div{ width:100px; height: 100px; background: red; margin-left: auto; margin-right: auto; } button{ display: block; width:100px; height: 100px; background: red; margin-left: auto; margin-right: auto; } </style> </head> <body> <div> div </div> <button>btn</button> </body> ~~~