• 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;}
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10

    二、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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20

    三、完整代码

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42

    ok,完工。

  • 相关阅读:
    Dubbo 路由及负载均衡性能优化
    ps命令介绍及常用操作和参数说明
    idea配置Idea类注释模板和方法注释模板(亲测有效)
    面试精选:3、史上最详细的Linux精选面试题(二)
    一文带你了解Windows操作系统安全,保护自己的电脑不受侵害
    InnoDB之Undo log格式
    2022年亚太C题资料汇总更新目录
    程序员面试金典 - 面试题 17.20. 连续中值
    Ubuntu QtCreator不能输入中文,可以从其他位置复制中文
    软件测试/测试开发丨Web自动化—capability参数配置 学习笔记
  • 原文地址:https://blog.csdn.net/zhaoyang314/article/details/134259914