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

1.6 KiB

id title challengeType dashedName
5f3477aefa51bfc29327200b Passo 15 0 step-15

--description--

Você estilizou três elementos escrevendo CSS dentro das tags style. Isso funciona, mas como haverá vários outros estilos, é melhor colocar todos os estilos em um arquivo separado e vincular a ele.

Criamos um arquivo separado styles.css para você e trocamos a visualização do editor para esse arquivo. Você pode alternar a visualização dos arquivos nas abas na parte superior do editor.

Comece reescrevendo os estilos que você criou no arquivo styles.css. Certifique-se de excluir a tag de abertura e de fechamento de style.

--hints--

Seu arquivo styles.css deve ter o seletor de tipo h1, h2, p.

(getUserInput) => {
  assert(getUserInput('editableContents').replace(/[\s\n]*/g, "").match(/(h1|h2|p),(h1|h2|p),(h1|h2|p){/));
}

O seletor deve definir a propriedade text-align para center.

(getUserInput) => {
  assert(getUserInput('editableContents').match(/text-align:\s*center;?/));
}

Você deve ter apenas um seletor.

(getUserInput) => {
  assert(getUserInput('editableContents').match(/text-align:\s*center;?/)?.length === 1);
}

--seed--

--seed-contents--

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

--fcc-editable-region--