Link styling must preserve discoverability. Users should be able to recognize links instantly, not guess clickable text.
Recommended defaults
- Keep underline for inline links or provide equivalent clarity.
- Differentiate
:hover,:focus-visible, and:visitedstates. - Maintain sufficient contrast in all states.
Rendered output
Important interview questions and answers
- Q: Why is removing underlines risky?
A: It can reduce affordance and hurt discoverability, especially in long text blocks. - Q: Which link pseudo-class order matters?
A: Commonly:link,:visited,:hover,:active. - Q: How do you style keyboard focus for links?
A: Use clear:focus-visibleoutline or equivalent high-contrast indicator.
Pitfall: Check cascade order—author stylesheet loses to inline styles and !important surprises.