一.代码实现
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link rel="stylesheet" href="./reset.css"> <style> body{ background-image: linear-gradient(to bottom,#fdf1d8,#b1bbf9); } .time-axis{ width: 804px; height: 700px; border: 2px red solid; margin: 50px auto 0; } .time-axis .left{ width: 400px; /*height: 300px;*/ float: left; border-right: 4px #b1bbf9 solid; position: relative; } .time-axis .right{ width: 400px; /*height: 300px;*/ float: right; border-left: 4px #b1bbf9 solid; position: relative; } .time-axis .dot{ width: 10px; height: 10px; background-color: #fff; display: block; border: 2px #b1bbf9 solid; border-radius: 50%; position: absolute; right: -9px; top: 50%; margin-top: -7px; } .time-axis .right .dot{ left:-9px; } .time-axis .jiantou{ width: 0; height: 0; border: 20px solid transparent; border-left-color: white ; position: absolute; right: 0px; top: 50%; margin-top: -16px; } .time-axis .right .jiantou{ width: 0; height: 0; border: 20px solid transparent; border-right-color: white ; left: 0; } .time-axis .con{ height: 200px; background-color: white; padding: 15px; border-radius: 10px; } .time-axis .left .con{ margin-right: 30px; } .time-axis .right .con{ margin-left: 30px; } </style></head><body> <div class="time-axis"> <div class="left"> <span class="dot"></span> <div class="jiantou"></div> <div class="con"></div> </div> <div class="right"> <span class="dot"></span> <div class="jiantou"></div> <div class="con"></div> </div> </div></body></html>