【uniapp】 uniapp的textarea组件为何使用margin显示不正常【和预期的效果不一样的原因】

 

   <view>
        <view class="own-flex-center">
            <!--【非常重要】uniApp的textarea组件,必须外层套一个view组件,并使用flex居中布局,这样设置的margin样式才会正常-->
            <textarea
                style="background: #00FF00;width: 100%;margin: 0 50px"
                placeholder="margin显示【正常】方法"/>
        </view>

        <br />
        <br />
        <br />
        <br />
        <br />
        <br />

        <!--如何直接在textarea组件使用margin属性,显示不会正常!-->
        <textarea
            style="background: blue;width: 100%;margin: 0 50px"
            placeholder="margin显示【不正常】方法"/>
    </view>

猜你喜欢

转载自blog.csdn.net/weixin_43343144/article/details/121389761
今日推荐