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

99 lines
2.7 KiB
Markdown
Raw Normal View History

---
id: 5ef9b03c81a63668521804d4
title: Step 32
challengeType: 0
dashedName: step-32
---
# --description--
L'elemento `strong` è usato per sottolineare l'importanza di una parte del testo.
Nell'elemento `figcaption` che hai appena aggiunto, indica che `hate` è di grande importanza inserendolo in un elemento `strong`.
# --hints--
L'elemento `strong` dovrebbe avere un tag di apertura. I tag di apertura hanno questa sintassi: `<nomeElemento>`.
```js
assert(document.querySelector('strong'));
```
L'elemento `strong` dovrebbe avere un tag di chiusura. I tag di chiusura hanno un carattere `/` subito dopo il carattere `<`.
```js
assert(code.match(/<\/strong\>/));
```
L'elemento `strong` dovrebbe circondare la parola `hate` nel testo `Cats hate other cats.` Hai omesso il testo o hai un refuso.
```js
assert(
document
.querySelectorAll('figcaption')[1]
.querySelector('strong')
.innerText.toLowerCase() === 'hate'
);
```
Il testo dell'elemento `figcaption` dovrebbe essere `Cats hate other cats.` Controlla eventuali errori e che ci siano gli spazi necessari attorno ai tag di apertura e chiusura dell'elemento `strong`.
```js
const secondFigCaption = document.querySelectorAll('figcaption')[1];
assert(
secondFigCaption &&
secondFigCaption.innerText
.replace(/\s+/gi, ' ')
.trim()
.match(/cats hate other cats\.?/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.">
<figcaption>Cats <em>love</em> lasagna.</figcaption>
</figure>
<h3>Top 3 things cats hate:</h3>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<figure>
<img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
--fcc-editable-region--
<figcaption>Cats hate other cats.</figcaption>
--fcc-editable-region--
</figure>
</section>
</main>
</body>
</html>
```