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)?
2 Antworten
+ 3
Nothing happenes if you select one element more than one time.
It overwrites all other properties and apply only last selection properties.
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