Chapter 1 deck Chapter 2 deck Chapter 3 deck Chapter 4 deck Chapter 5 deck Chapter 6 deck Chapter 7 deck Chapter 8 deck Chapter 9 deck Chapter 10 deck Chapter 11 deck Chapter 12 deck Chapter 13 deck Chapter 14 deck

HTML5 APIs, Responsive Design & Accessibility

5 slides · use ←/→ or Space to navigate, F for fullscreen.

Reading view

← Back to the full Chapter 4 deck

HTML5 APIs, Responsive Design & Accessibility
Fullscreen for presentation · Print / PDF for a handout
1 / 5
Lesson

HTML5 APIs, Responsive Design & Accessibility

The full API picture, responsive techniques, and making HTML5 accessible.

HTML5 APIs, Responsive Design & Accessibility

HTML5 APIs — The Full Picture

APIPurpose
Canvas 2D APIDraw shapes, text and images via JavaScript
Web Workers APIBackground threads for heavy computation
History APIManipulate browser history without a page reload
Fetch APIModern replacement for XMLHttpRequest
Web Storage APIlocalStorage and sessionStorage
Drag & Drop APINative drag-and-drop interactions
Notifications APIDisplay native desktop notifications
Fullscreen APIRequest fullscreen for any element
GeolocationAccess user location with permission
File APIRead local files in the browser
WebSocket APIFull-duplex real-time communication
Server-Sent EventsPush data from server to browser
HTML5 APIs, Responsive Design & Accessibility

HTML5 & Responsive Web Design

Viewport meta tag

<meta name="viewport" content="width=device-width, initial-scale=1">

Controls how the browser scales the page on mobile devices — essential for all responsive sites.

Flexible images

img { max-width: 100%; height: auto; }

CSS media queries

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { width: 100%; }
}

CSS Grid & Flexbox

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

Modern CSS layout systems replace table-based and float-based layouts with responsive-friendly alternatives.

HTML5 APIs, Responsive Design & Accessibility

HTML5 & Web Accessibility

PracticeDetail
Semantic HTML5 elementsScreen readers understand <nav>, <main>, <article> — no extra ARIA needed for basic structure.
Alt text for images<img alt="Description"> provides text alternatives.
Captioned mediaThe <track> element adds subtitles, captions and descriptions to video and audio.
ARIA attributesrole, aria-label, aria-describedby, aria-live enhance complex interactive widgets.
Keyboard navigationAll interactive elements must be keyboard-focusable (Tab / Enter / Space) with visible focus indicators.
Colour contrastWCAG 2.1 requires 4.5:1 for normal text and 3:1 for large text.
HTML5 APIs, Responsive Design & Accessibility

Activity — complete the code

Complete the responsive page setup.

<meta name="" content="width=device-width, initial-scale=1">
 
img {
max-width: ;
height: auto;
}
 
.grid {
display: grid;
grid-template-columns: repeat(, minmax(200px, 1fr));
}