freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-by-building-a-ca.../5ef9b03c81a63668521804d0.md

86 lines
2.2 KiB
Markdown

---
id: 5ef9b03c81a63668521804d0
title: Step 25
challengeType: 0
dashedName: step-25
---
# --description--
Metti in evidenza la parola `love` nell'elemento `figcaption` inserendola in un elemento `em`.
# --hints--
L'elemento `em` dovrebbe avere un tag di apertura. I tag di apertura hanno questa sintassi: `<nomeElemento>`.
```js
assert(document.querySelector('em'));
```
L'elemento `em` dovrebbe avere un tag di chiusura. I tag di chiusura hanno un carattere `/` subito dopo il carattere `<`.
```js
assert(code.match(/<\/em\>/));
```
Hai cancellato l'elemento `figcaption` oppure manca un tag di apertura o chiusura.
```js
assert(document.querySelector('figcaption') && code.match(/<\/figcaption\>/));
```
L'elemento `em` dovrebbe racchiudere il testo `love`. Hai omesso il testo o hai un refuso.
```js
assert(
document.querySelector('figcaption > em').innerText.toLowerCase() === 'love'
);
```
Il testo dell'elemento `figcaption`dovrebbe essere `Cats love lasagna`. Controlla eventuali errori e che ci siano gli spazi necessari attorno ai tag di apertura e chiusura dell'elemento `em`.
```js
assert(
document
.querySelector('figcaption')
.innerText.replace(/\s+/gi, ' ')
.match(/cats love lasagna\.?/i)
);
```
# --seed--
## --seed-contents--
```html
<html>
<body>
<main>
<h1>CatPhotoApp</h1>
<section>
<h2>Cat Photos</h2>
<!-- TODO: Add link to cat photos -->
<p>Click here to view more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a>.</p>
<a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>
</section>
<section>
<h2>Cat Lists</h2>
<h3>Things cats love:</h3>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<figure>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" alt="A slice of lasagna on a plate.">
--fcc-editable-region--
<figcaption>Cats love lasagna.</figcaption>
--fcc-editable-region--
</figure>
</section>
</main>
</body>
</html>
```