伙计,Css时间轴文本对齐
我想用css构建一个时间轴,我对这些红色圆圈有问题。我想添加一些信息,这些信息应该在红圈(最多一个或两个字)内垂直和水平居中文本,我可以请求您的帮助吗?
.timeline-image {
text-align: center;
margin: 0 auto;
width: 390px;
height: 390px;
background: rgba(203, 190, 181, 0.3);
border-radius: 50%;
}
.timeline-image img {
position: relative;
z-index: 99999;
top: -30px;
}
.timeline ul li {
list-style: none;
position: relative;
width: 1px;
margin: 0 auto;
padding-top: 10px;
background: #b2b2b2;
}
.timeline ul li:after {
content: "";
position: absolute;
left: 50%;
bottom: 0;
transform: translateX(-50%);
width: 87px;
height: 87px;
border-radius: 50%;
background: red;
top: 76%;
}
.timeline ul li div {
position: relative;
bottom: 0;
left: 100px;
top: 120px;
width: 400px;
padding: 15px;
background: transparent;
}
.timeline ul li:nth-child(even) div {
left: -439px;
}
.timeline ul li:nth-child(even) div:before {
right: -15px;
border-width: 8px 0px 8px 16px;
border-color: transparent transparent transparent #F45B69;
}
.timeline h3 {
font-family: "Open-Sans", sans-serif;
font-size: 34px;
margin-bottom: 20px;
}
.timeline p {
font-family: "Open-Sans", sans-serif;
font-size: 16px;
color: #555;
margin-bottom: 32px;
}
.timeline ul li a {
font-family: "Open-Sans-Bold", sans-serif;
font-size: 16px;
color: #000;
text-decoration: none;
}
.timeline ul li a:hover {
opacity: 0.7;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section class="timeline">
<div class="container">
</div>
<ul>
<li>
<div>
<img src="images/timeline1.jpg" width="324" height="125" title="someText" alt="someText">
<h3>Lorem</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,</p>
<a href="#" class="read-more">lorem
\t \t \t \t \t \t \t \t <img src="images/example-arrow.png" title="someText" alt="someText">
\t \t \t \t \t \t \t </a>
</div>
</li>
<li>
<div>
<img src="images/timeline2.jpg" width="324" height="125" title="someText" alt="someText">
<h3>Lorem</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
<a href="#" class="read-more">Lorem
\t \t \t \t \t \t \t \t <img src="images/example-arrow.png" title="someText" alt="someText">
\t \t \t \t \t \t \t </a>
</div>
</li>
<li>
<div>
<img src="images/timeline3.jpg" width="324" height="125" title="someText" alt="someText">
<h3>Lorem</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
<a href="#" class="read-more">lorem
\t \t \t \t \t \t \t \t <img src="images/example-arrow.png" title="someText" alt="someText">
\t \t \t \t \t \t \t </a>
</div>
</li>
<li>
<div>
<img src="images/timeline4.jpg" width="324" height="125" title="someText" alt="someText">
<h3>Lorem</h3>
<p>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>
<a href="#" class="read-more">lorem
\t \t \t \t \t \t \t \t <img src="images/example-arrow.png" title="someText" alt="someText">
\t \t \t \t \t \t \t </a>
</div>
</li>
</ul>
</section>
<!-- timeline -->
请提供更多信息,你的代码做什么。 – Peter
现在什么都没有,我只是试图在这些红色圆圈内添加一些居中的文字,但我不知道如何完成它。 –