欢迎分享,转载请注明来源:内存溢出
div叠加在上方居中对齐_div居中上下对齐
方法一#wrap{ position:absolute; width:300px; height:200px; top:50%; left:50%; transform:translate(-50%,-50%) ; background:#009688; } 若是下面的代码,其结果就是错误的#wrap{ width:300px; height:200px; margin-top:50%; margin-left:50%; transform:translate(-50%,-50%) ; background:#009688; }原因:当margin设置成百分数的时候,其top right bottom left的值是参照父元素盒子的宽度进行计算方法二直接用d性盒布局,作用于父元素上实现parent{ width:100%; height:100vh; display:flex; justify-content: center;//子元素水平居中 align-items: center;//子元素垂直居中
赞
(0)
打赏
微信扫一扫
支付宝扫一扫
arm汇编指令详解pdf_arm指令集是指汇编指令
上一篇
2022-04-17
毕业设计文档格式_文档编辑排版的基本步骤
下一篇
2022-04-17
评论列表(0条)