freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-typography-by-buildin.../615f34ecc1091b4fd5a8a484.md

1.7 KiB

id title challengeType dashedName
615f34ecc1091b4fd5a8a484 Step 4 0 step-4

--description--

All'interno dell'elemento head, aggiungi un elemento link con l'attributo rel impostato su stylesheet e l'attributo href con il valore https://fonts.googleapis.com/css?family=Open+Sans:400,700,800.

In questo modo, importerai la famiglia di caratteri Open Sans, con spessori di 400, 700, e 800.

Aggiungi anche un elemento link per collegare il file styles.css.

--hints--

Dovresti avere due elementi link auto-concludenti.

assert(document.querySelectorAll('link').length === 2);

Entrambi gli elementi link dovrebbero avere un attributo rel con il valore stylesheet.

const links = [...document.querySelectorAll('link')];
assert(links.every(link => link.getAttribute('rel') === 'stylesheet'));

Uno degli elementi link dovrebbe avere un attributo href con il valore ./styles.css.

assert(code.match(/<link[\s\S]*?href\s*=\s*('|"|`)(\.\/)?styles\.css\1/g)?.length === 1);

Uno degli elementi link dovrebbe avere attributo href con il valore https://fonts.googleapis.com/css?family=Open+Sans:400,700,800.

const links = [...document.querySelectorAll('link')]
assert(links.find(link => link?.getAttribute('href') === 'https://fonts.googleapis.com/css?family=Open+Sans:400,700,800'));

--seed--

--seed-contents--

--fcc-editable-region--
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Nutrition Label</title>

  </head>
  <body>
    <h1>Nutrition Facts</h1>
    <p>8 servings per container</p>
    <p>Serving size 2/3 cup (55g)</p>
  </body>
</html>
--fcc-editable-region--