It is widely known that pseudo-classes for links must follow the LoVe-HAte rule:
a:link a:visited a:hover a:active
But what is the right place to place the pseudo selector a:focus? There are two possible options, from my point of view - before and after :hover. I want to know which way is right.
a:focus
:hover
var. 1 var. 2 a:link | a:link a:visited | a:visited a:focus | a:hover a:hover | a:focus a:active | a:active
A small note: On the Internet, I have already seen someone say to put it in front :hover. On the other hand, someone else says that it should be located after :hover. But in all such cases, the reasons were not discussed. Or, sometimes, reasoning was too difficult to understand.
, -, :focus ( SO):
:focus
, . DOM Level 2 HTML, , focus() - HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement HTMLAnchorElement. HTMLButtonElement HTMLAreaElement.
, , "" , , , , , .
, , :hover :link :visited CSS , :link :visited, , :active , , :active :hover.
:link
:visited
:active
:focus click, active, hover , "" , .
click
active
hover
, :focus 1- :focus (<button> ):
<button>
/* placed 1st */ input:focus {background: limegreen;} input:link {color: red;} input:visited {color: green;} input:hover {color: hotpink;} input:active {color: blue;} button:link {color: red;} /* placed 2nd */ button:focus {background: limegreen;} button:visited {color: green;} button:hover {color: hotpink;} button:active {color: blue;} a:link {color: red;} a:visited {color: green;} /* placed 3rd */ a:focus {background: limegreen;} a:hover {color: hotpink;} a:active {color: blue;} select:link {color: red;} select:visited {color: green;} select:hover {color: hotpink;} /* placed 4th */ select:focus {background: limegreen;} select:active {color: blue;} textarea:link {color: red;} textarea:visited {color: green;} textarea:hover {color: hotpink;} textarea:active {color: blue;} /* placed last */ textarea:focus {background: limegreen;}
<textarea name="" id="" cols="30" rows="10"></textarea><br> <select name="" id=""> <option value="a">first</option> <option value="b">second</option> </select> <input type="text"><br> <a href="#">Anchor link</a><br> <button type="text">Click Me</button>
, , 2 - a: link, a: visited, a: hover, a: focus, a: active.
, . , , , (, ). - , . , , (), .
, . - , ) b) . (a) , , , enter ( ). (b) , - , , .
, vs visited - , - . , , ( ), , , , , . , , , () ().
Source: https://habr.com/ru/post/1666442/More articles:Calculate weighted average value in SQL Server - sql-serverpandas: a merged (internal bit) data frame has more rows than the original - pythonPassing values โโbetween non-parent / child components in Angular 2 - javascriptusing angular2 with a sharepoint base - angularPython - integrate a two-dimensional kernel density estimate in contour lines - pythonJavaScript variable color in JetBrains WebStorm - javascriptDisplay current username in _Layout view - c #A memory leak after an algorithm in Rails? - garbage-collectionMethod for efficiently calculating XOR (^) checksum based on list of identifiers - pythonVisual Studio 2017 development by MSBuild - visual-studio-2017All Articles