css - 创建一条垂直线,其中有一个圆圈,边上的文本与圆圈对齐

标签 css twitter-bootstrap

我正在尝试在我的网站上实现以下内容:

enter image description here

显然这应该能够进行更多次迭代,我真的不知道要用谷歌搜索什么,我找到了一种创建线条的方法,但我不知道如何将其与 Circles 结合以及如何制作那些与文本对齐的。

最终代码:

* {
    box-sizing: border-box;
}

ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

ul li div {
    width: 50%;
    float: left;
    text-align: center;
}

ul li .zero-left {
    position: relative;
    color: #EB908B;
    width: 30%;
    text-align: right;
    padding-right: 20px;
}

ul li .zero-right {
    border-left: 3px solid #3C4C4C;
    position: relative;
    color: #3C4C4C;
    width: 70%;
    padding-left: 15px;
    text-align: left;
}

ul li .first {
    position: relative;
    color: #EB908B;
    width: 30%;
    text-align: right;
    padding-right: 20px;
}

ul li .second {
    border-left: 3px solid #3C4C4C;
    position: relative;
    width: 70%;
    padding-left: 15px;
    text-align: left;
}

ul li .second p {
    color: #EB908B;
    position: relative;
    text-align: left;
}

ul li .first::before {
    content: '';
    position: absolute;
    right: -11.5px;
    width: 20px;
    height: 20px;
    border-radius: 150%;
    border: 2px solid #3C4C4C;
    background: #3C4C4C;
    z-index:9999
}

最佳答案

你可以使用after 伪元素来放置圆圈。这里我用after解决方案做了一个例子。

jsfiddle

关于css - 创建一条垂直线,其中有一个圆圈,边上的文本与圆圈对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42186455/

相关文章:

javascript - bootstrap modal 显示先前调整大小的 textarea

html - Datepicker 在 <th> 元素内不工作

html - CSS/Bootstrap/HTML - 带有底部边框和填充的 Div...如何防止在边距或填充上扩展边框?

python - Django 图像没有关联的文件,即使我有空白和 null

css 模糊技术仅适用于背景

javascript - 在网站推送时压缩 .js 和 .css 文件

javascript - 导航栏在滚动 Bootstrap 4 上更改颜色

javascript - Ruby on Rails - Bootstrap 轮播按钮不起作用

css - 在 Angular 5 中导入 scss 的更简单方法

javascript - 带 Bootstrap 的动态表