2022-05-26 16:20:33 +00:00
---
id: 60f0286404aefb0562a4fdf9
title: Passo 4
challengeType: 0
dashedName: step-4
---
# --description--
2022-06-22 13:17:46 +00:00
Adicione um elemento `title` ao `head` e dê ao projeto um título de `Registration Form` . Da mesma forma, aninhe 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` .
2022-05-26 16:20:33 +00:00
# --hints--
O código deve ter um elemento `title` .
```js
const title = document.querySelector('title');
assert.exists(title);
```
O elemento `title` deve estar dentro do elemento `head` .
```js
assert.exists(document.querySelector('head > title'));
```
O projeto deve ter o título `Registration Form` .
```js
const title = document.querySelector('title');
assert.equal(title.text.toLowerCase(), 'registration form')
```
Lembre-se, maiúsculas, minúsculas e a ortografia são importantes para o título.
```js
const title = document.querySelector('title');
assert.equal(title.text, 'Registration Form');
```
O código deve ter um elemento `link` .
```js
2022-06-27 13:55:35 +00:00
assert.exists(document.querySelector('link'));
2022-05-26 16:20:33 +00:00
```
Você não deve alterar as tags `head` existentes. Verifique se você não excluiu a tag de fechamento.
```js
const heads = document.querySelectorAll('head');
assert.equal(heads?.length, 1);
```
O elemento `link` deve ser um elemento de fechamento automático.
```js
assert(code.match(/< link [ \w\W\s]+ \/> /i));
```
O elemento `link` deve estar dentro do elemento `head` .
```js
2022-06-27 13:55:35 +00:00
assert.exists(document.querySelector('head > link'));
2022-05-26 16:20:33 +00:00
```
O elemento `link` deve ter um atributo `rel` com o valor `stylesheet` .
```js
2022-06-27 13:55:35 +00:00
const link_element = document.querySelector('link');
const rel = link_element.getAttribute("rel");
assert.equal(rel, "stylesheet");
2022-05-26 16:20:33 +00:00
```
2022-06-22 13:17:46 +00:00
O elemento `link` deve ter o atributo `href` com o valor `styles.css` .
2022-05-26 16:20:33 +00:00
```js
2022-06-27 13:55:35 +00:00
const link = document.querySelector('link');
assert.equal(link.dataset.href, "styles.css");
2022-05-26 16:20:33 +00:00
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
< html >
--fcc-editable-region--
< head >
< / head >
< body >
< / body >
--fcc-editable-region--
< / html >
```