Which technique provides accessible focus styles for keyboard navigation without overwhelming mouse users?

Prepare for the CSS Mastery SAD Maintenance and CSA Stand Ups Test. With flashcards and multiple choice questions, ready yourself for the exam with hints and explanations for every question. Ace your exam today!

Multiple Choice

Which technique provides accessible focus styles for keyboard navigation without overwhelming mouse users?

Explanation:
Focus indicators should appear when a user is navigating with the keyboard, but not clutter the page for mouse users. The best approach uses the :focus-visible pseudo-class because it automatically shows the focus outline only when the navigation method warrants it—typically when the user tabs to an element—so keyboard users always see where the focus is, while mouse interactions don’t produce constant outlines. To be truly accessible, couple this with a clearly visible outline that has good color contrast against the element and its background. It's wise to include a fallback for environments that don't support :focus-visible by also styling :focus, so the indicator still appears on focus. This combination keeps the UI clean for mouse users while preserving clear, accessible focus for keyboard users.

Focus indicators should appear when a user is navigating with the keyboard, but not clutter the page for mouse users. The best approach uses the :focus-visible pseudo-class because it automatically shows the focus outline only when the navigation method warrants it—typically when the user tabs to an element—so keyboard users always see where the focus is, while mouse interactions don’t produce constant outlines. To be truly accessible, couple this with a clearly visible outline that has good color contrast against the element and its background. It's wise to include a fallback for environments that don't support :focus-visible by also styling :focus, so the indicator still appears on focus. This combination keeps the UI clean for mouse users while preserving clear, accessible focus for keyboard users.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy