2022-05-03 16:06:49 +00:00
|
|
|
---
|
|
|
|
id: 5f344f9c805cd193c33d829c
|
|
|
|
title: Passo 12
|
|
|
|
challengeType: 0
|
|
|
|
dashedName: step-12
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
|
|
|
Você pode adicionar estilo a um elemento, especificando-o no elemento `style` e definindo uma propriedade para ele assim:
|
|
|
|
|
|
|
|
```css
|
|
|
|
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`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const hasSelector = new __helpers.CSSHelp(document).getStyle('h1');
|
|
|
|
assert(hasSelector);
|
|
|
|
```
|
|
|
|
|
2022-05-16 14:06:15 +00:00
|
|
|
Sua propriedade `text-align` deve ter um valor de `center`.
|
2022-05-03 16:06:49 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
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`.
|
|
|
|
|
|
|
|
```js
|
|
|
|
const h1TextAlign = new __helpers.CSSHelp(document).getStyle('h1')?.getPropertyValue('text-align');
|
|
|
|
assert(h1TextAlign === 'center');
|
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```html
|
|
|
|
<!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>
|
|
|
|
```
|
|
|
|
|