64 lines
1.3 KiB
Markdown
64 lines
1.3 KiB
Markdown
---
|
|
id: 6133acc353338c0bba9cb553
|
|
title: Step 5
|
|
challengeType: 0
|
|
dashedName: step-5
|
|
---
|
|
|
|
# --description--
|
|
|
|
All'interno dell'elemento `head`, l'elemento `title` è utile ai lettori di schermo per capire il contenuto di una pagina. Inoltre, è una parte importante della _SEO_.
|
|
|
|
Assegna alla pagina un elemento `title` che sia descrittivo e conciso.
|
|
|
|
# --hints--
|
|
|
|
Dovresti aggiungere un elemento `title` all'interno dell'elemento `head`.
|
|
|
|
```js
|
|
assert.exists(document.querySelector('head > title'));
|
|
```
|
|
|
|
Non dovresti avere un `title` più lungo di 60 caratteri.
|
|
|
|
```js
|
|
assert.isAtMost(document.querySelector('head > title')?.textContent?.length, 60);
|
|
```
|
|
|
|
Cerca di essere più descrittivo con l'elemento `title`. _Suggerimento: Almeno 15 caratteri_
|
|
|
|
```js
|
|
assert.isAtLeast(document.querySelector('head > title')?.textContent?.length, 15);
|
|
```
|
|
|
|
# --seed--
|
|
|
|
## --seed-contents--
|
|
|
|
```html
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
--fcc-editable-region--
|
|
<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" />
|
|
<link rel="stylesheet" href="styles.css" />
|
|
</head>
|
|
--fcc-editable-region--
|
|
<body>
|
|
|
|
</body>
|
|
</html>
|
|
|
|
```
|
|
|
|
```css
|
|
body {
|
|
background: #f5f6f7;
|
|
color: #1b1b32;
|
|
font-family: Helvetica;
|
|
margin: 0;
|
|
}
|
|
```
|