Question · HTML and CSS course · Module 10: Accessibility (a11y)

focus vs focus-visible

Why is :focus-visible better than :focus for styling outlines?

Answer options

  • There is no difference between :focus and :focus-visible
  • :focus-visible shows the outline only during keyboard navigation, not on mouse clicks
  • :focus-visible is computationally faster
  • :focus-visible only works in modern browsers

You can check the correct answer by solving this task in the CodeWorlds game.