您好,欢迎来到欧宁财经。
搜索
您的当前位置:首页html+css的垂直居中容器

html+css的垂直居中容器

来源:欧宁财经


这次给大家带来html+css的垂直居中容器,使用html+css的垂直居中容器的注意事项有哪些,下面就是实战案例,一起来看一下。

<!DOCTYPE html><html lang="en"><head>
 <meta charset="UTF-8">
 <title>Document</title>
 <style>
 *{ margin: 0; padding: 0;
 } .parent{ width: 400px; height: 400px; border:1px solid gray; position: relative;
 } .child{ width: 100px; height: 100px; top:0; left:0; right:0; bottom:0; margin:auto; background: pink; position: absolute;
 } </style></head><body>
 <div class="parent">
 <div class="child"></div>
 </div></body></html>

相信看了本文案例你已经掌握了方法,更多精彩请关注Gxl网其它相关文章!

相关阅读:

在HTML中用CSS实现文本截断

JS实现贝叶斯分类器

H5的Canvas如何实现绘制音乐环形频谱图

Copyright © 2019- onup.cn 版权所有

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务