在<view>里设置了justify-content:space-around对<view>下面的<input><button>不起作用
< view class = "post-input-container" >
< input type = "text" placeholder = "输入内容" class = "post-input" />
< button class = "post-send-btn" >发送</ button >
</ view >
|
.post-input-container {
position : fixed ;
bottom : 0 ;
width : 100% ;
height : 100 rpx;
display : flex;
flex- direction : row;
justify- content : space-around;
align-items: center ;
background-color :chartreuse;
}
.post-input-container .post-input {
width : 50% ;
height : 80 rpx;
background-color :beige;
}
.post-input-container .post-send-btn {
width : 30% ;
height : 80 rpx;
background-color : bisque;
}
|
margin
:
0
rpx;
button组件里自带了margin-left和margin-right导致的这种情况,你可以在button样式里加上margin:0;就好了
非常感谢!又学到了个解决问题的思路!
建议代码 修改,将input和button用view标签包裹,去掉input和button的宽度限制
感谢回答!问题已解决!