What line of code do you use to change text color? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What line of code do you use to change text color?

(for HTML, text-color doesn't work.

17th Jul 2018, 2:43 PM
hyac-nth
hyac-nth - avatar
4 Answers
+ 2
style="color: color_name" Color_name can be a hex code or rgb/rgba value too
17th Jul 2018, 2:46 PM
TurtleShell
TurtleShell - avatar
+ 2
/*in css file*/ .your_class{ color: red; } /*or in html*/ <div style="color:red;"></div>
17th Jul 2018, 2:58 PM
Yuri Biasi
Yuri Biasi - avatar
+ 2
Thanks, Yuri Biasi!
4th Sep 2018, 1:57 PM
hyac-nth
hyac-nth - avatar
+ 1
<h1 style="color:lightblue">Help</h1> Here style is an attribute to h1 tag. It is an inline css (You will study this in Css lessons). Hope this helps☺️☺️.
17th Jul 2018, 3:26 PM
Meet Mehta
Meet Mehta - avatar