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

1.3 KiB

id title challengeType dashedName
5f344f9c805cd193c33d829c Passo 12 0 step-12

--description--

Você pode adicionar estilo a um elemento, especificando-o no elemento style e definindo uma propriedade para ele assim:

element {
 property: value;
}

Centralize seu elemento h1 definindo sua propriedade text-align para o valor center.

--hints--

Você deve adicionar um elemento h1 ao elemento style.

const hasSelector = new __helpers.CSSHelp(document).getStyle('h1');
assert(hasSelector);

Sua propriedade text-align deve ter um valor de center.

const hasTextAlign = new __helpers.CSSHelp(document).getCSSRules().some(x => x.style['text-align'] === 'center');
assert(hasTextAlign);

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

const h1TextAlign = new __helpers.CSSHelp(document).getStyle('h1')?.getPropertyValue('text-align');
assert(h1TextAlign === 'center');

--seed--

--seed-contents--

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