button 设置边距后 文字内容不居中。
发布于 6 年前 作者 xia21 12831 次浏览 来自 问答

直接上代码了。 运行结果是文字偏下。这是为什么呢。如果不设置 边距(margin: 10rpx;)就是正常的。

<view class=‘main_view’>

<view class=‘query_view’>

<input class=‘query_input’></input>

<button class=‘query_btn’>查询</button>

</view>

</view>

.query_view{

height: 100rpx;

display: flex;

background-color: #ff00ff;

}

.query_input

{

margin: 10rpx;

width: 50%;

height: auto;

align-content: center;

background-color: #ededed;

}

.query_btn

{

width: 20%;

margin: 10rpx;

}

回到顶部