简体   繁体   English

如何从css或bootstrap实现此水平线

[英]how to achieve this this horizontal line from css or bootstrap

I am working in a project which involves html,css and bootstrap for front end designing. 我正在一个涉及html,css和bootstrap进行前端设计的项目中工作。

Is there any way to get this view either from bootstrap itself or using core css? 有没有办法从引导程序本身或使用核心CSS来获得此视图? can someone provide me a code how to get this line 有人可以给我一个代码如何获得这条线 在此处输入图片说明

Hmm this could be done in 100 ways and this is probably not the cleanest one, but it works :) Im creating a div.line with 3 div.bullets where the last bullet has a before AND an after assigned to it. 嗯,这可以用100种方法来完成,但这可能不是最干净的方法,但是它可以工作:)我用3个div.bullets创建了一个div.line ,其中最后一个项目符号分配了一个before和一个after。

JSFIDDLE JSFIDDLE

Here is a CSS only solution using pseudo element. 这是使用pseudo元素的纯CSS解决方案。 This solution will adjust to the width of the page when resized. 调整大小时,此解决方案将调整为页面的宽度。

 ul, li { list-style: none; } li { float: left; position: relative; height: 2px; width: 30%; background-color: cornflowerblue; } li:before { content: ''; position: absolute; height: 10px; width: 10px; border-radius: 50%; top: 1px; transform: translateY(-50%); background-color: cornflowerblue; } li:last-child { width: 0px; } 
 <ul> <li></li> <li></li> <li></li> <li></li> </ul> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM