自学内容网 自学内容网

CSS例子:居中的例子

HTML

<view class="content">
<view class="item"></view>
</view>

CSS

.content {
height: 600rpx;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background-color: aqua;
}

.item {
width: 100rpx;
height: 100rpx;
border: 3rpx blueviolet solid;
background-color: aquamarine;
}

tailwind css

<view class="h-[600rpx] flex flex-row justify-center items-center bg-green-600">
<view class="w-[100rpx] h-[100rpx] border-[3px] bg-red-600"></view>
</view>


原文地址:https://blog.csdn.net/winnershili/article/details/143436219

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!