freeCodeCamp/curriculum/challenges/portuguese/14-responsive-web-design-22/learn-html-forms-by-buildin.../60f0286404aefb0562a4fdf9.md

97 lines
2.0 KiB
Markdown
Raw Normal View History

---
id: 60f0286404aefb0562a4fdf9
title: Passo 4
challengeType: 0
dashedName: step-4
---
# --description--
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`.
# --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
assert.exists(document.querySelector('link'));
```
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
assert.exists(document.querySelector('head > link'));
```
O elemento `link` deve ter um atributo `rel` com o valor `stylesheet`.
```js
const link_element = document.querySelector('link');
const rel = link_element.getAttribute("rel");
assert.equal(rel, "stylesheet");
```
O elemento `link` deve ter o atributo `href` com o valor `styles.css`.
```js
const link = document.querySelector('link');
assert.equal(link.dataset.href, "styles.css");
```
# --seed--
## --seed-contents--
```html
<!DOCTYPE html>
<html>
--fcc-editable-region--
<head>
</head>
<body>
</body>
--fcc-editable-region--
</html>
```