I have designed a timeline featuring milestones with circular images using the CSS property (border-radius: 100%)
. I am attempting to create arrows at both the top and bottom of each .milestone-image-holder element by utilizing the :before and :after pseudo elements. However, it appears that I can only apply an arrow to either the top or bottom, but not both simultaneously.
Below is the HTML code:
<ul class="milestones">
<li class="milestone-left">
<div class="milestone-img-holder">
<img src="/assets/images/page/about-us/our-history/timeline_2011.jpg" />
</div>
<h5>2011</h5>
<p>
Sample text
</p>
</li>
</ul>
CSS Styling:
ul.milestones li.milestone-left .milestone-img-holder {
position: relative;
margin-left: -80px;
float: left;
}
ul.milestones li.milestone-right .milestone-img-holder {
position: relative;
margin-right: -80px;
float: right;
}
ul.milestones .milestone-img-holder:after, ul.milestones .milestone-img-holder:before {
bottom: 98%;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
ul.milestones .milestone-img-holder:after {
border-color: rgba(238, 59, 52, 0);
border-bottom-color: #EE3B34;
border-width: 3px;
margin-left: -3px;
}
ul.milestones .milestone-img-holder:before {
border-color: rgba(238, 59, 52, 0);
border-bottom-color: #EE3B34;
border-width: 9px;
margin-left: -9px;
}
ul.milestones img {
position: relative;
width: 10em;
-webkit-border-radius: 100%;
border-radius: 100%;
border: 3px solid #ee3b34;
background: #CCC;
}
The provided CSS will only display an arrow at either the top or bottom. Altering properties such as bottom: 99%
to top: 99%
, and border-bottom-color: #ee3b34
to border-top-color: #ee3b34
will switch the arrow position. Unfortunately, achieving both arrows simultaneously seems challenging. Is this feasible?