How can you use CSS to improve web accessibility?

Instruction: Discuss methods of using CSS to enhance accessibility on the web.

Context: This question tests the candidate's awareness of accessibility principles and their ability to apply them through CSS.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

Use CSS to support readable content and operable controls while keeping semantic HTML. Good presentation includes sufficient contrast, visible focus, flexible sizing and layouts that still work when text is enlarged.

<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CSS example</title> <style> body { margin: 1rem; color: #111; background: #fff; font: 1rem/1.5 system-ui; } main { max-width: 60ch; overflow-wrap: anywhere; } a { color: #0645ad; text-decoration: underline; } a:focus-visible, button:focus-visible { outline: 3px solid #111; outline-offset: 3px; } button { font: inherit; padding:...

Related Questions