Answer the question
In order to leave comments, you need to log in
Show block using css selector :focus - is it possible?
Good day to all!
The task is as follows: passing through the navigation with a tab, make it so that a submenu opens.
In the following example
, I tried to implement this only with css, through the :focus pseudo-class (51st line in the code)
However, this does not work.
The google output says that this can be solved:
Answer the question
In order to leave comments, you need to log in
You :focus on the link, so it doesn't work. More precisely, the style is applied to it, but it cannot “climb up” the css tree, even if desired.
Apply to li and everyone will be healthy and happy.
For example, something like
It is not entirely clear what is needed, but, probably, so that the drop-down block is not "lost" on hover?
Example 1: https://jsfiddle.net/yu3ver/vcghvsyv/
Example 2: https://jsfiddle.net/yu3ver/kzah26oa/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question