I am trying to achieve this specific effect but I cannot seem to do it.
I've tried creating a ::after pseudo element, tried the new "text-underline-offset" property but it doesn't work so well with older browsers, I can't seem to do it.
I am trying to re-create this 1:1 so the text is the exact same and the design is the exact same. the other problem is that the header expands into two lines.
What could I use to achieve this?
HTML
.update_slider {
margin-bottom: rem(100);
}
.update_slider__update {
width: rem(350);
margin-right: rem(50);
}
.update_slider__update__img {
height: rem(200);
margin-bottom: rem(20);
}
.update_slider__update__img img {
height: 100%;
width: 100%;
object-fit: cover;
}
.update_slider__update__header {
border-bottom: 1px solid #dce0e5;
padding-bottom: rem(15);
position: relative;
}
.update_slider__update__header h3 {
font-size: rem(30);
font-weight: 600;
}
.update_slider__update__header h3:hover {
text-decoration-line: underline;
text-decoration-style: solid;
text-decoration-color: red;
text-decoration-thickness: 10px;
}
.update_slider__update__timestamp {
margin-top: rem(15);
margin-bottom: rem(20);
}
.update_slider__update__timestamp__time {
margin-bottom: rem(8);
}
.update_slider__update__timestamp__type {
color: orange;
font-weight: 500;
}
<div class="update_slider__update">
<div class="update_slider__update__img">
<img src="assets/img/news-placeholder-4.jpg" alt="" />
</div>
<div class="update_slider__update__header">
<h3>Lorem ipsum dolor sit amet, consectetur</h3>
</div>
<div class="update_slider__update__timestamp">
<div class="update_slider__update__timestamp__time">
<p>Posted 7th December 2020</p>
</div>
<div class="update_slider__update__timestamp__type">
<p>Selling, Mortgages</p>
</div>
</div>
<div class="update_slider__update__button">
<a href="#" class="btn_main btn_orange">Read News</a>
</div>
</div>