I have linear gradient text. What I'm trying to achieve is to have text-underline with same colors like text:
What I have already tried:
- Default text-decoration: underline gives me non gradiented line which is way to big, and I can't actually customize it at all.
- ::after pseudoclass gives me underline but it's under whole text block
- box shadow is affected by line-height, and I can't get this line closer to text.
body {
background: black;
}
h1 {
font-size: 120px;
display: inline;
line-height: 130px;
position: relative;
text-decoration: underline;
background: linear-gradient(330deg, #ff6553 0, #ff1979 50%, #ffa400 100%);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h1::after {
position: absolute;
display: inline;
content: "";
width: 100%;
height: 2px;
background: white;
bottom: 0;
left: 0;
}
<div class="text">
<h1>some text with <br> colorful gradient</h1>
</div>
Here's my code fiddle:
