Skip to content
Learn Netverks

Lesson

Step 29/31 94% through track

accessibility-css

Accessibility: HTML semantics + CSS visibility

Last reviewed Jun 1, 2026 Content v20260601
Track mode
iframe_html
Means
HTML preview sandbox
Reading
~1 min
Level
advanced

This lesson

This lesson teaches Accessibility: HTML semantics + CSS visibility—the ideas, syntax, and habits you need before moving on in HTML & CSS.

Accessible markup and styles are a legal and UX requirement on professional web teams.

You will apply Accessibility: HTML semantics + CSS visibility in contexts like: Landing pages, dashboards, marketing sites, and portfolio pieces built without a framework.

Read the lesson, edit HTML/CSS in the playground, press Run to preview, then answer the lesson MCQs.

When intermediate lessons feel comfortable and you are ready for production-style trade-offs.

Accessibility is a partnership: HTML provides names and roles; CSS must not break them—visible focus, readable contrast, motion preferences, and content that still makes sense when styles fail.

High-impact checks

  • Keyboard: every action reachable; focus order matches reading order.
  • Contrast: text vs background (WCAG AA is a common team target).
  • Target size: roughly 44×44 CSS px for touch (use padding, not tiny icons alone).
  • Do not remove outlines without a visible :focus-visible replacement.

Visually hidden but available to screen readers

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

Use for extra context on icons—not to hide required labels.

Challenge

Icon button with accessible name

  1. Give the icon button a visible or sr-only text name.
  2. Ensure :focus-visible ring is obvious.

Done when: screen reader users hear a name; keyboard users see focus.

Go deeper — Senior review script (5 minutes) (intermediate / experienced)
  1. Tab through the page once—any missing focus?
  2. Zoom 200%—does content reflow without loss?
  3. Toggle reduced motion—does UI remain usable?
  4. Run automated axe/Lighthouse on the template.
  5. Spot-check heading order and one form field label.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs in your browser in a sandboxed frame. Backend runners appear when this track’s profile allows them.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • What part of this lesson needs a second read?
  • What would you try differently in a real project?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump