Why link color is not setting to white? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why link color is not setting to white?

Here is code. In the code, white color is mentioned in the a:link, but it's not working. https://code.sololearn.com/W812b2GeEEyH/?ref=app

8th May 2020, 2:35 AM
Himanshu Rai
Himanshu Rai - avatar
14 Answers
+ 5
Himanshu Rai By default, the 'a' tag has some text decorations. Like it has underline, it has color as blue and cursor as pointer. By setting text decoration none, you remove the default text decoration. And hence, then you can style it as your own needs!
8th May 2020, 2:59 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 2
Hey, add these lines of CSS : a { text-decoration: none; color: #fff; }
8th May 2020, 2:40 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 2
Add a:visited{ /*CSS Rules here*/ } This will be the styles applied to each link that has been clicked on.
9th May 2020, 4:05 PM
Nwosu Darlington
+ 2
hi, if you want you can look up how hex codes work. a hex code controls the color. #FFFFFF is white #000000 is black. the first two digits represent the amount of red in the color and so on... its a bit confusing but there is a system to it
9th May 2020, 7:54 PM
madeline
madeline - avatar
+ 1
It's worked! So it means that for only a:link, the color property is defined separately? What is the reason behind this behaviour? Thanks for responding
8th May 2020, 2:55 AM
Himanshu Rai
Himanshu Rai - avatar
+ 1
So can be directly mention text-decoration:none inside a:link ?
8th May 2020, 3:09 AM
Himanshu Rai
Himanshu Rai - avatar
+ 1
It is pseudo selector, that styles different states of link. So, how can be it wrong?
8th May 2020, 3:16 AM
Himanshu Rai
Himanshu Rai - avatar
+ 1
Actually, by 'wrog' I wanted mean 'in this case' it shouldn’t be used. You are trying to make the color of link to white right? :link pseudo class will only style the a tag which hasn’t been visited. Is that what you want?
8th May 2020, 3:20 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
0
😊
8th May 2020, 3:05 AM
Himanshu Rai
Himanshu Rai - avatar
0
Actually, you are using it wrong :)) Wrong : a:link{ background-color: red; color:white; padding: 14px 25px; } Correct : a { background-color: red; color:white; padding: 14px 25px; text-decoration: none; } It is not 'a:link'. It's only 'a'. You should learn css selectors bro :))
8th May 2020, 3:12 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
0
Yes.
8th May 2020, 3:29 AM
Himanshu Rai
Himanshu Rai - avatar
0
So, it should work on unvisited link and display the link color white. But it's not working bro
8th May 2020, 3:31 AM
Himanshu Rai
Himanshu Rai - avatar
0
Thanks guys for helping me!😁👍
8th May 2020, 5:04 AM
Himanshu Rai
Himanshu Rai - avatar
0
تد ذره ع ها
10th May 2020, 12:47 AM
naim draji
naim draji - avatar