css布局两个button在同父标签中左右两侧分布的方法

本文主要介绍了css布局两个button在同父标签中左右两侧分布的方法,分享给大家,具体如下:

效果图

css布局两个button在同父标签中左右两侧分布的方法

布局代码

<view class="grace-footer" style="width:100%;" slot="gFooter">
 <view style="float:right;width:50%">
    <button type="primary" style="line-height: 85rpx; margin: 25rpx; "  @click="saveService(scanKay,tableList)">提交</button> 
 </view>
 <view style="float:left;width:50%">
  <button type="warn" style="line-height: 85rpx; margin: 25rpx;"  @click="removeService()">重置</button>
 </view>
   
</view>

style="float:right;width:50%"
就是在父标签容器中的右侧,并且占据50%宽度

style="float:left;width:50%"
就是在父标签容器中的左侧侧,并且占据50%宽度

grace-footer是GraceUI 引入的css代码是 效果是底部导航

.grace-footer{
     position:fixed; 
     z-index:2; left:0; 
     bottom:0; 
     background:#FFFFFF; 
     width:750rpx; 
     overflow:hidden; 
     box-shadow:1px 1px 6px #888;
}