How do you create multicolored text in a webpage?
Printable View
How do you create multicolored text in a webpage?
you can use the <font color=?color?>?</font> tags for every character
To create text with different colors, use the <font color=?color?>?</font> tags for every character that you want to apply a color. You can use this tag combination as many times as needed, surrounding a single character or an entire word.
Book Name Change Ad in Newspaper | Book Lost and Found Ad in Newspaper | Book Public Notice Ad in Newspaper
Learm more about these at Web Designing Training in Chandigarh
The best way would be as suggested above. However for such a simple thing i would not create inline style as it will case render block on you website and slow it down also making the code unusable on other pages. Rather put the css in a in you websites style sheet :
Html :
<span class="white">R</span>
<span class="blue">a</span>
<span class="pink">i</span>
<span class="red">n</span>
In the css you would have :
.white {
Color : #ffffff;
}
.whiteblue {
Color : #xxxxx;
}
.pink {
Color : #xxxxx;
}
.red {
Color : #xxxxx;
}
\\ The xxxx is just because im too lazy to look up the hex codes for those colours. Now if you are on another page you can call on the class again you can also add other properties to the classes if you would like
THis however is also a pretty neat idea :)Quote:
. multicolored {
background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
color:transparent;
-webkit-background-clip: text;
background-clip: text;
<span style="color:#f00">R</span>
<span style="color:#f50">a</span>
<span style="color:#ff0">i</span>
<span style="color:#5f0">n</span>
In the above code, actually it is wrapping each letter in it’s own element.
Otherwise, there is another way, you should write a below CSS code.
. multicolored {
background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
color:transparent;
-webkit-background-clip: text;
background-clip: text;
}
Then call above CSS “multicolored” Class into your Html code. Below is the Html example.
<span class="multicolored">Mobile app development and Web development company India</span>
-------------
Are you looking for Best Gifts and Toys for 3 Year Old girls (Review) in 2020. Get the list of best toys for your 3 years old Girls.