栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

创建由线连接的CSS3圆

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

创建由线连接的CSS3圆

您可以使用伪元素和相邻的同级选择器(~)来实现此效果,而无需额外的标记:

li {  width: 2em;  height: 2em;  text-align: center;  line-height: 2em;  border-radius: 1em;  background: dodgerblue;  margin: 0 1em;  display: inline-block;  color: white;  position: relative;}li::before{  content: '';  position: absolute;  top: .9em;  left: -4em;  width: 4em;  height: .2em;  background: dodgerblue;  z-index: -1;}li:first-child::before {  display: none;}.active {  background: dodgerblue;}.active ~ li {  background: lightblue;}.active ~ li::before {  background: lightblue;}<ul>  <li>1</li>  <li>2</li>  <li>3</li>  <li >4</li>  <li>5</li>  <li>6</li>  <li>7</li></ul>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/615193.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号