freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-accessibility-by-buil.../614206033d366c090ca7dd42.md

141 lines
3.5 KiB
Markdown
Raw Normal View History

---
id: 614206033d366c090ca7dd42
title: Step 17
challengeType: 0
dashedName: step-17
---
# --description--
Il carattere tipografico gioca un ruolo importante nell'accessibilità di una pagina. Alcuni font sono più facili da leggere rispetto ad altri, e questo è particolarmente vero su schermi a bassa risoluzione.
Cambia il font di entrambi gli elementi `h1` e `h2` in `Verdana` e usa un altro font web-safe della famiglia sans-serif come fallback.
Inoltre, aggiungi una proprietà `border-bottom` di `4px solid #dfdfe2` agli elementi `h2` per rendere distinte le sezioni.
# --hints--
Dovresti utilizzare un di elementi multiplo per selezionare gli elementi `h1` e `h2`.
```js
const gs = (s) => new __helpers.CSSHelp(document).getStyle(s);
assert.exists(gs('h1, h2') || gs('h2, h1'));
```
Dovresti impostare il primo valore della proprietà `font-family` su `Verdana`.
```js
const gs = (s) => new __helpers.CSSHelp(document).getStyle(s);
const style = gs('h1, h2') || gs('h2, h1');
assert.include(style?.fontFamily, 'Verdana');
```
Dovresti impostare il secondo valore della proprietà `font-family` su un altro font web-safe sans-serif. _Suggerimento: sceglierei Tahoma_.
```js
// Acceptable fonts: Arial, sans-serif, Helvetica, Tahoma, Trebuchet MS.
const gs = (s) => new __helpers.CSSHelp(document).getStyle(s);
const style = gs('h1, h2') || gs('h2, h1');
assert.match(style?.fontFamily, /(Tahoma)|(Arial)|(sans-serif)|(Helvetica)|(Trebuchet MS)/);
```
Dovresti usare un selettore di elementi `h2` per selezionare gli elementi `h2`.
```js
assert.exists(new __helpers.CSSHelp(document).getStyle('h2'));
```
Dovresti assegnare a `h2` una proprietà `border-bottom` con il valore `4px solid #dfdfe2`.
```js
assert.equal(new __helpers.CSSHelp(document).getStyle('h2')?.borderBottom, '4px solid rgb(223, 223, 226)');
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="freeCodeCamp Accessibility Quiz practice project" />
<title>Accessibility Quiz</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<header>
<img id="logo" src="https://cdn.freecodecamp.org/platform/universal/fcc_primary.svg">
<h1>HTML/CSS Quiz</h1>
<nav>
<ul>
<li><a>INFO</a></li>
<li><a>HTML</a></li>
<li><a>CSS</a></li>
</ul>
</nav>
</header>
<main>
<form method="post" action="https://freecodecamp.org/practice-project/accessibility-quiz">
<section role="region" aria-labelledby="student-info">
<h2 id="student-info">Student Info</h2>
</section>
<section role="region" aria-labelledby="html-questions">
<h2 id="html-questions">HTML</h2>
</section>
<section role="region" aria-labelledby="css-questions">
<h2 id="css-questions">CSS</h2>
</section>
</form>
</main>
</body>
</html>
```
```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;
}
--fcc-editable-region--
--fcc-editable-region--
```