freeCodeCamp/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-basic-css-by-building.../5f3477cb2e27333b1ab2b955.md

1.7 KiB

id title challengeType dashedName
5f3477cb2e27333b1ab2b955 Passo 17 0 step-17

--description--

Agora você precisa vincular o arquivo styles.css para que os estilos sejam aplicados novamente. Adicione um elemento link de fechamento automático ao elemento head. Dê a ele o valor do atributo rel de stylesheet e o valor do atributo href de styles.css.

--hints--

O código deve ter um elemento link.

const link = document.querySelector('link');
assert(link);

Você não deve mudar o elemento head existente. Verifique se você não excluiu a tag de fechamento.

assert($('head').length === 1);

Você deve ter um elemento link de autofechamento.

const link = document.querySelectorAll('link');
assert(link.length === 1);

O elemento link deve estar dentro do elemento head.

const link = document.querySelector('head > link');
assert(link);

O elemento link deve ter o atributo rel com o valor stylesheet.

const link = document.querySelector('link')
const rel = link.getAttribute('rel')
assert(rel == `stylesheet`)

O elemento link deve ter o atributo href com o valor styles.css.

const link = document.querySelector('link')
assert(link.dataset.href == 'styles.css')

--seed--

--seed-contents--

<!DOCTYPE html>
<html lang="en">
--fcc-editable-region--
  <head>
    <meta charset="utf-8" />
    <title>Cafe Menu</title>
  </head>
--fcc-editable-region--
  <body>
    <main>
      <header>
        <h1>CAMPER CAFE</h1>
        <p>Est. 2020</p>
      </header>
      <section>
        <h2>Coffee</h2>
      </section>
    </main>
  </body>
</html>
h1, h2, p {
  text-align: center;
}