收藏
回答

skyline模式下的margin为什么无效?

skyline模式下,手机端排版margin和padding都失效,

手机端webview和开发者工具skyline和webview中,margin和padding都是可以的


wxml代码
<view class="goods_category">
    <view class="goods_category_swiper">
        <view wx:key="*this" wx:for="{{goods_category}}" class="goods_category_item" bindtap="select_category" data-goods_category_id="{{item.id}}">
            <image src="{{item.img}}"></image>
            <view class="goods_category_title" wx:if="{{item.is_select == 1}}" style="background-color: #003B90;color:white;">{{item.title}}</view>
            <view class="goods_category_title" wx:else>{{item.title}}</view>
        </view>
    </view>
    
</view>



wxss代码
.goods_category_swiper {width:auto;height:192rpx;display: flex;overflow-x: scroll; margin-top:32rpx;}
.goods_category_swiper::-webkit-scrollbar {width0;}
.goods_category_item{width:136rpx;height:148rpx;margin:0 0 0 40rpx;}
.goods_category_item image{width:96rpx;height:96rpx;}
.goods_category_title{width:96rpx;height:52rpx;line-height52rpx;text-align: center;border-radius26rpx;color:black;font-size:24rpx;background-color: white;}



goods_category_item中的margin或换成padding都无效

回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员-Jahozheng
    社区技术运营专员-Jahozheng
    03-26

    请按照链接提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    03-26
    有用
    回复
登录 后发表内容