70-480 question 14 discussion


You are developing a web page by using HTML5 and CSS3.
Hyperlinks on the page must be rendered with a style that reflects the last user action
You need to style the four anchor elements in the document.
In what order should you specify the four anchor selectors? (To answer, move the
appropriate anchor selectors from the list of CSS codes to the answer area and arrange
them in the correct order.)

Created 8 months, 3 weeks ago by nedo


Note: a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective! a:active MUST come after a:hover in the CSS definition in order to be effective! Pseudo-class names are not case-sensitive.


The answer here is wrong can some provide the correct answer


Absolutely correct answer provided.


A:link A:hover A:active A:visited


No. The answer is correct. See below www.w3.org description. https://www.w3.org/TR/CSS21/selector.html#dynamic-pseudo-classes a:link { color: red } /* unvisited links */ a:visited { color: blue } /* visited links */ a:hover { color: yellow } /* user hovers */ a:active { color: lime } /* active links */ Note that the A:hover must be placed after the A:link and A:visited rules, since otherwise the cascading rules will hide the 'color' property of the A:hover rule. Similarly, because A:active is placed after A:hover, the active color (lime) will apply when the user both activates and hovers over the A element.


link, visited, hover, active


link, visited, hover, active


easy reminder ... LoVe before HAte


There is another pseudo class A:focus also which has not been asked in question. So if you want to remember that as well then tweak the quote to - "LoVe For HAte"


What does the style order matter, you can style any in any order, try it!


What is the difference above between the answer in green and answer in red?