--- id: 614202874ca576084fca625f title: Step 16 challengeType: 0 dashedName: step-16 --- # --description-- Ogni attributo role con valore `region` richiede un'etichetta visibile, che dovrebbe essere referenziata dall'attributo `aria-labelledby`. Dai agli elementi `section` i seguenti attributi `aria-labelledby`: - `student-info` - `html-questions` - `css-questions` Poi, all'interno di ogni elemento `section` annida un elemento `h2` con un `id` che corrisponde all'attributo `aria-labelledby`. Assegna a ogni elemento `h2` un testo adatto. # --hints-- Dovresti dare al primo elemento `section` un attributo `aria-labelledby` con il valore `student-info`. ```js assert.equal(document.querySelectorAll('section')?.[0]?.getAttribute('aria-labelledby'), 'student-info'); ``` Dovresti dare al secondo elemento `section` un attributo `aria-labelledby` con il valore `html-questions`. ```js assert.equal(document.querySelectorAll('section')?.[1]?.getAttribute('aria-labelledby'), 'html-questions'); ``` Dovresti dare al terzo elemento `section` un attributo `aria-labelledby` con il valore `css-questions`. ```js assert.equal(document.querySelectorAll('section')?.[2]?.getAttribute('aria-labelledby'), 'css-questions'); ``` Dovresti annidare un elemento `h2` all'interno del primo elemento `section`. ```js assert.equal(document.querySelectorAll('section')?.[0]?.querySelectorAll('h2')?.length, 1); ``` Dovresti annidare un elemento `h2` all'interno del secondo elemento `section`. ```js assert.equal(document.querySelectorAll('section')?.[1]?.querySelectorAll('h2')?.length, 1); ``` Dovresti annidare un elemento `h2` all'interno del terzo elemento `section`. ```js assert.equal(document.querySelectorAll('section')?.[2]?.querySelectorAll('h2')?.length, 1); ``` Dovresti assegnare al primo elemento `h2` un attributo `id` con il valore `student-info`. ```js assert.equal(document.querySelectorAll('h2')?.[0]?.id, 'student-info'); ``` Dovresti assegnare al secondo elemento `h2` un attributo `id` con il valore `html-questions`. ```js assert.equal(document.querySelectorAll('h2')?.[1]?.id, 'html-questions'); ``` Dovresti assegnare al terzo elemento `h2` un attributo `id` con il valore `css-questions`. ```js assert.equal(document.querySelectorAll('h2')?.[2]?.id, 'css-questions'); ``` Dovresti assegnare al primo elemento `h2` un testo adatto. _Suggerimento: io avrei scelto `Student Info`_ ```js assert.isAtLeast(document.querySelectorAll('h2')?.[0]?.textContent?.length, 1); ``` Dovresti assegnare al secondo elemento `h2` un testo adatto. _Suggerimento: io avrei scelto `HTML`_ ```js assert.isAtLeast(document.querySelectorAll('h2')?.[1]?.textContent?.length, 1); ``` Dovresti assegnare al terzo elemento `h2` un testo adatto. _Suggerimento: io avrei scelto `CSS`_ ```js assert.isAtLeast(document.querySelectorAll('h2')?.[2]?.textContent?.length, 1); ``` # --seed-- ## --seed-contents-- ```html Accessibility Quiz

HTML/CSS Quiz

--fcc-editable-region--
--fcc-editable-region--
``` ```css body { background: #f5f6f7; color: #1b1b32; font-family: Helvetica; margin: 0; } header { width: 100%; height: 50px; background-color: #1b1b32; display: flex; } #logo { width: max(100px, 18vw); background-color: #0a0a23; aspect-ratio: 35 / 4; padding: 0.4rem; } h1 { color: #f1be32; font-size: min(5vw, 1.2em); } nav { width: 50%; max-width: 300px; height: 50px; } nav > ul { display: flex; justify-content: space-evenly; } ```