首页 > 解决方案 > 如何使用 css 选择器居中对齐该元素?

问题描述

尝试将墨水条更改为圆形,但我已经完成了,但我很难将其居中对齐。谁能给我一些建议?

.ant-tabs-ink-bar {
  display: flex;
  //align-items: center;
  //vertical-align: middle;
  width: 8px !important;
  height: 8px;
  line-height: 8px;
  border-radius: 50%;
}

编辑害羞萤火虫 hex9

标签: csslayoutflexboxcss-selectorsantd

解决方案


只需将其包装在容器中并将以下 CSS 提供给容器即可。

.container{
  display:flex;
  justify-content:center;
}

推荐阅读