.thumb-text {
position: absolute;
width: fit-content;
left: 50%;
transform: translateX(-50%);
}
.thumb-text h3 {
font-family: Georgia;
font-size: 30px;
color: black;
font-weight: 900;
}
.thumb-text h3::after {
content: '';
position: absolute;
top: 100;
right: 0;
bottom: 0;
left: 0;
height: 3px;
background: linear-gradient(0.25turn, rgba(255, 249, 34), rgba(255, 0, 128), rgba(56, 2, 155, 0))
}
<div style="text-align: center;" class="thumb-text">
<h3> Title </h3>
<p> description </p>
</div>
My attempt to create a gradient underline using ::after
was successful when there was only a title present. However, upon adding another text below the title, the underline shifted below the added text instead of following the original rule set in ::after. I noticed that there were no issues when using a border-bottom property in h3 instead of a gradient underline. It appears that there might be an issue with my implementation of ::after. Can someone assist me in resolving this problem?