el-upload el-button居中
时间: 2023-10-08 19:08:12 浏览: 188
要将 `el-upload` 和 `el-button` 居中对齐,你可以使用以下方法:
1. 使用`flexbox`布局:
你可以将 `el-upload` 和 `el-button` 放在一个父容器内,并为父容器应用 `display: flex; justify-content: center; align-items: center;` 的样式,这样它们就会水平居中对齐。
```html
<div style="display: flex; justify-content: center; align-items: center;">
<el-upload></el-upload>
<el-button></el-button>
</div>
```
2. 使用`text-align`属性:
如果你只是想让它们在水平方向上居中,你可以将父容器的 `text-align: center;` 属性应用于它们的父元素,并使用 `display: inline-block;` 或 `display: inline-flex;` 来使它们水平排列。
```html
<div style="text-align: center;">
<el-upload style="display: inline-block;"></el-upload>
<el-button style="display: inline-block;"></el-button>
</div>
```
这些方法可以帮助你将 `el-upload` 和 `el-button` 居中对齐。根据你的具体情况,你可以选择适合的方法来实现居中对齐。