Help me add a another color to my h1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Help me add a another color to my h1

Hello Sololearners, Please help me add a another color to my h1(achaemenid empire title) https://code.sololearn.com/W7v7llaGg97k/?ref=app

30th Jul 2023, 10:40 AM
Faraz Haghbayan
Faraz Haghbayan - avatar
6 Answers
+ 3
you can put the word or words inside a span and add inline style to it. <h1 class="title">The <span style="color:red">Achaemenid Empire</span></h1>
30th Jul 2023, 10:55 AM
Bob_Li
Bob_Li - avatar
+ 3
There are various ways. First is inline style like in my first reply. with css, you can define a class or a custom tag. css using class: .red{ color:red; } <h1 class="title">The <span class="red">Achaemenid Empire</span></h1> css custom tag: red{ color:red; } <h1 class="title">The <red>Achaemenid Empire</red></h1>
30th Jul 2023, 11:02 AM
Bob_Li
Bob_Li - avatar
+ 2
you don't have to add the 'css custom tag' part. also, you did not use the tag in your html https://code.sololearn.com/WoLtkZO2O7v1/?ref=app https://code.sololearn.com/WWD7662Uy575/?ref=app
30th Jul 2023, 11:14 AM
Bob_Li
Bob_Li - avatar
0
Yes sir! I will try that right away!
30th Jul 2023, 11:03 AM
Faraz Haghbayan
Faraz Haghbayan - avatar
0
Bob_Li I tried but it didn't work,why?
30th Jul 2023, 11:12 AM
Faraz Haghbayan
Faraz Haghbayan - avatar
0
Ooooooooh 😲😬 Thanks sir!
30th Jul 2023, 11:19 AM
Faraz Haghbayan
Faraz Haghbayan - avatar