CSS时间线样式

编程入门 行业动态 更新时间:2024-10-08 22:13:24

CSS时间线<a href=https://www.elefans.com/category/jswz/34/1771146.html style=样式"/>

CSS时间线样式

css实现时间线样式,效果如下图:

一、CSS代码

.timeline {padding-left: 5px}			.timeline-item { position: relative;padding-bottom: 20px;}			.timeline-axis {position: absolute;left: -5px;top: 0;z-index: 10;width: 20px;height: 20px;line-height: 20px;background-color: #fff;color: #16b777;border-radius: 50%;text-align: center;cursor: pointer;}			.timeline-axis:hover {color: #ff5722}			.timeline-item:before {content: "";position: absolute;left: 5px;top: 0;z-index: 0;width: 1px;height: 100%;background: #16b777;}	.timeline-item:first-child:before {display: block;}			.timeline-item:last-child:before {display: none;}			.timeline-content {padding-left: 25px;}			.timeline-title {position: relative;margin-bottom: 10px;line-height: 22px}.roundness{background-color: #16b777;}

二、html代码

<div class="mythBox mid timeline"><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div></div>

三、完整代码

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><meta name="viewport" content="width=device-width, maximum-scale=1, initial-scale=1" /><style>.timeline {padding-left: 5px}			.timeline-item { position: relative;padding-bottom: 20px;}			.timeline-axis {position: absolute;left: -5px;top: 0;z-index: 10;width: 20px;height: 20px;line-height: 20px;background-color: #fff;color: #16b777;border-radius: 50%;text-align: center;cursor: pointer;}			.timeline-axis:hover {color: #ff5722}			.timeline-item:before {content: "";position: absolute;left: 5px;top: 0;z-index: 0;width: 1px;height: 100%;background: #16b777;}	.timeline-item:first-child:before {display: block;}			.timeline-item:last-child:before {display: none;}			.timeline-content {padding-left: 25px;}			.timeline-title {position: relative;margin-bottom: 10px;line-height: 22px}.roundness{background-color: #16b777;}</style></head><body><div class="mythBox mid timeline"><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div><div class="timeline-item"><i class="timeline-axis roundness"></i><div class="timeline-content text"><div class="timeline-title">2005年大学毕业</div></div></div></div></body>
</html>

ok,完工。

更多推荐

CSS时间线样式

本文发布于:2023-11-15 23:43:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609811.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:样式   时间   CSS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!