弄了个盒子 盒子里面装了个按钮 按钮写了外边距后强行把盒子带下来了 怎么解决
这是代码
.top{
height: 400rpx;
background-color: rgba(0, 148, 255);
}
.context{
color: white;
}
.login_btn{
margin-top: 30rpx;
}
.root {
display: flex;
flex-direction: column;
align-items: center;
}
.pitch{
width: 200rpx;
height: 200rpx;
border-radius: 50%;
margin-top: 30rpx;
margin-bottom: 10rpx;
}
<view class="top">
<button class="login_btn" wx:if="{{!userInfo}}" bindtap="login">微信登录</button>
<view wx:else class="root">
<image class="pitch" src="{{userInfo.avatarUrl}}"></image>
<text class="context">{{userInfo.nickName}}</text>
<button bindtap="loginOut" type="warn">退出登录</button>
</view>
</view>