首页 > 其他 > 详细

如何让子元素在父元素中居中

时间:2019-11-10 00:52:14      阅读:173      评论:0      收藏:0      [点我收藏+]
<view class="father">

<view class="son">

</view>

</view>
.father{
width: 600rpx;
height: 600rpx;
background-color: orangered;
position: relative;
}
.son{
width: 300rpx;
height: 200rpx;
background-color: lawngreen;
position: absolute;
top: 50%;
left: 50%;
margin-top: -100rpx;
margin-left: -150rpx;
}

 

如何让子元素在父元素中居中

原文:https://www.cnblogs.com/P201721440036/p/11828624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!