css - 如何使用 css 选择器居中对齐该元素?
问题描述
尝试将墨水条更改为圆形,但我已经完成了,但我很难将其居中对齐。谁能给我一些建议?
.ant-tabs-ink-bar {
display: flex;
//align-items: center;
//vertical-align: middle;
width: 8px !important;
height: 8px;
line-height: 8px;
border-radius: 50%;
}
解决方案
只需将其包装在容器中并将以下 CSS 提供给容器即可。
.container{
display:flex;
justify-content:center;
}
推荐阅读
- c# - itext hml2pdf:在 2.1.0 版之后,在源 html 中声明字体不起作用
- c++ - 在 C++ 中使用 UTF-8 解析 XML
- ipywidgets - ipywidgets:GridspecLayout 网格间隙似乎不起作用
- json - 使用结构读取 JSON
- vb6 - 组件 MSCOMCTL.OCX 或其依赖项之一未正确注册
- python - 用于多句子文本相似度的通用句子编码器
- c++ - 带有引用和指针的指针的重载返回
- javascript - 如何删除所有 p (小写和大写)中的 js 一词?在Javascript中
- javascript - 是否可以从抽象中调用子方法?
- python - 图形带通滤波器