Any idea on how to change text color for 2 parts of gradient line? For example here if I want the blue part of the text ('s', 'o' and a part of 'm') to be black?
.button{
background: linear-gradient(140deg, #00C9FF 35%, transparent 35%);
}
Step 1: Apply a basic background to the body tag and align the text to center of the page. Step 2: Do some basic styling like font-size and family etc. Step 3: Apply the linear gradient property with any colors of your choice.
To add a gradient overlay to a text element, we need to set three different CSS properties to the text we want to style: background-image: <gradient> background-clip: text. text-fill-color: transparent.
To create the most basic type of gradient, all you need is to specify two colors. These are called color stops. You must have at least two, but you can have as many as you want.
Which of the following CSS Gradient Functions sets the direction and colors of a gradient that fades from one color to the next in a straight line? Explanation: Self-explainatory. 2.
You can do it wrapping the text in a <p>
tag and setting a linear-gradient
to this tag.
button{
background: linear-gradient(140deg, #00C9FF 35%, transparent 35%);
color: white;
font-size: 30px;
}
p{
margin: 0;
font-size: 50px;
background: -webkit-linear-gradient(130deg, red 65%, black 15%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
<button type="button"><p>some long text</p></button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With