COLOR attribute belongs to HTML or CSS ??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

COLOR attribute belongs to HTML or CSS ???

COLOR attribute belongs to HTML or CSS ??? it worked for CSS but not for HTML. can we use "Color" attribute to change text color in HTML.

28th Jul 2017, 6:20 PM
Md Rameez Rana
Md Rameez Rana - avatar
5 Answers
+ 10
html: <p style = "red"> This is a colored line of text </p> css: p { color:red; } You can use both
28th Jul 2017, 6:25 PM
Ramon Berenguer
Ramon Berenguer - avatar
+ 3
There is also <font color='red'>This is red text.</font> in pure HTML.
28th Jul 2017, 6:29 PM
Christian Barraza
Christian Barraza - avatar
+ 2
Ramon dear I think that is css . inline CSS, if I am not wrong
28th Jul 2017, 6:34 PM
Md Rameez Rana
Md Rameez Rana - avatar
+ 2
Before css, you had to add all styles in the html file, so, developers thought in a way to make it easier, thats how css born. So, it can belong to the both files, but if you try to do it all in the html file, you will spend a lot of time styling your page.
28th Jul 2017, 8:25 PM
Mane Antonio
Mane Antonio - avatar
+ 1
it means we can change color indirectly using <font> tag. instead of directly using it ,like : <h1 color ="blue"> heading </h1>
28th Jul 2017, 6:32 PM
Md Rameez Rana
Md Rameez Rana - avatar