由于项目需要采用的是card的形式
这是普通的水平居中
水平居中代码主要是加style=“text-align: center”
<a-card class="UpSet1">
<!-- <div style="display: flex;align-items: center;justify-content: center;height: 100px;"> -->
<div style="text-align: center;">
<a-button style="width: 150px;height: 50px;">取消</a-button>
<a-button style="width: 150px;height: 50px;" type="primary">保存</a-button>
</div>
<!-- <el-button type="text" @click="client()">客户端升级下载限制</el-button> -->
</a-card>
//这是css部分
.UpSet1 {
width: 1680px;
height: 160px;
}
全页面居中后的效果
代码部分
<a-card class="UpSet1">
<div style="display: flex;align-items: center;justify-content: center;height: 100px;">
<a-button style="width: 150px;height: 50px;">取消</a-button>
<a-button style="width: 150px;height: 50px;" type="primary">保存</a-button>
</div>
</a-card>
css同上