Table of Contents
text-decoration-color
in CSS doesn't accept linear-gradient()
as input, only conventional color values. So this tutorial is a workaround using an ::after
pseudo element.How to add a gradient underline in Carrd
- Copy and paste this code snippet into an Embed element on your page:
<style>
.gradient-text::after {
content: "";
position: absolute;
left: 25%; /* Adjust the position of the gradient underline */
bottom: -10%; /* Adjust the position of the gradient underline */
width: 184px;
height: 5px; /* Adjust the height of the gradient underline */
background: linear-gradient(to right, #ff9900, #9900ff); /* Gradient colors */
}
</style>
- Add
gradient-text
as a class in the Setting of the Text element you want to underline
- Tweak the position of the gradient underline by adjusting the
left
andbottom
values
- Change the colours used in the gradient by adjusting the
background
values