Careeroza
Alt Text & Labels
Good Alt Text
| Image | Bad alt | Good alt |
|---|---|---|
| Product photo | alt="image" | alt="Blue running shoes, side view" |
| Logo linking home | alt="logo" | alt="Careeroza home" |
| Chart | alt="chart" | alt="Sales grew from 2 to 5 lakh between Jan and Jun" |
| Decorative swirl | alt="swirl" | alt="" (skipped by screen readers) |
Every Input Needs a Label
Example
A placeholder is not a label: it disappears while typing and is often low-contrast. Link labels to inputs:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<label for="email">Email address</label><br>
<input type="email" id="email" name="email" autocomplete="email"><br><br>
<!-- wrapping also works -->
<label><input type="checkbox" name="terms"> I accept the terms</label>
</body>
</html>Result
Buttons and Links
- Use
<button>for actions and<a href>for navigation, never a clickable<div>: real elements work with the keyboard for free. - Link text must make sense out of context: "Download the 2024 report", not "click here".
- Icon-only buttons need an accessible name:
<button aria-label="Close dialog">✕</button>.