0

What happens if we select an html element more than once in CSS?

Suppose we have to style the link, <!DOCTYPE html> <html> <head> <style> a{ text-decoration: none;} a: link{ color: green;} a:visited{ color: red;} a: active{ color: blue;} </style> </head> <body> <a href="https://www.google.com" >Google</a> </body> </html> Are they going to work(all of them)?

22nd May 2019, 4:45 AM
Mousin Ahanger
Mousin Ahanger - avatar
2 odpowiedzi
+ 3
Nothing happenes if you select one element more than one time. It overwrites all other properties and apply only last selection properties.
22nd May 2019, 5:40 AM
Raj Chhatrala
Raj Chhatrala - avatar
0
Nothing unusual happens, because these are different states, it will never be underlined, because it overwrites the element, like this: div { background: red; height: 80px; } div { background: blue; width: 20px; } Now all rhe div elements look like this: the background is blue, it has an 80px height and 20px width
22nd May 2019, 4:54 AM
Airree
Airree - avatar