uniapp 文字环绕图片效果

在uniapp  开发小程序过程中,使用css float实现文字环绕图片效果,在IOS设备上不起效果,查阅资料,最终实现了兼容android和iOS的文字环绕图片效果

实现效果如下:

实现代码:

view页面

<view class="max-line">
                                <image class='childcare-collection-content-left-image'
                                    src="../../../static/login/logo.png">
                                </image>
                                <view style="display: flex;flex-direction: row;">
                                    <text
                                        style="font-size: 30rpx;color: #000000;text-align: left;margin-top: 20rpx;margin-bottom: 16rpx;">可可。nick</text>
                                    <text
                                        style="font-size: 30rpx;color: #000000;margin-left: 20rpx;text-align: left;margin-top: 20rpx;margin-bottom: 16rpx;">2岁6个月</text>
                                </view>
                                <br>
                                <text class="childcare-collection-content-right-down-description"
                                >sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss</text>

 </view>

父容器

.max-line {
        width: 100%;
        margin: 0 auto;
    }

子容器

.childcare-collection-content-left-image {
        float: left;
        display: block;
        box-sizing: border-box;
        clear: both;
        width: 176rpx;
        height: 176rpx;
        border-radius: 20rpx 20rpx 20rpx 20rpx;
        margin: 30rpx;
    }

.childcare-collection-content-right-down-description {
        line-height: 1.5;
        font-size: 26rpx;
        color: #888888;
        overflow-wrap: break-word;
        word-break: break-all;
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值