flex相关布局

待补充

一、实现三栏布局

html

<view class="bg">
    <text class="left">dhfs</text>
    <text class="center">绝代风华地方就是</text>
    <text class="right">很费时间</text>
</view>

style

<style lang="scss">
    .bg {
        width: 100%;
        height: 130rpx;
        background-color: pink;
        display: flex;

        .left {
            flex: 1;
            text-align: center;
        }
        .center {
            flex: 3;
            text-align: center;
        }
        .right {
            flex: 1;
            text-align: center;
        }
    }
</style>

image.png

评论

暂无评论