71 lines
1.4 KiB
Markdown
71 lines
1.4 KiB
Markdown
|
---
|
||
|
id: 62cc5b1779e4d313466f73c5
|
||
|
title: Passo 5
|
||
|
challengeType: 0
|
||
|
dashedName: step-5
|
||
|
---
|
||
|
|
||
|
# --description--
|
||
|
|
||
|
Adicione 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 `link`.
|
||
|
|
||
|
```js
|
||
|
assert.exists(document.querySelector('link'));
|
||
|
```
|
||
|
|
||
|
Você não deve mudar 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);
|
||
|
```
|
||
|
|
||
|
Você deve ter um elemento `link` de autofechamento.
|
||
|
|
||
|
```js
|
||
|
assert(document.querySelectorAll('link').length === 1);
|
||
|
```
|
||
|
|
||
|
O elemento `link` deve estar dentro do elemento `head`.
|
||
|
|
||
|
```js
|
||
|
assert.exists(document.querySelector('head > link'));
|
||
|
```
|
||
|
|
||
|
O elemento `link` deve ter o 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 lang="en">
|
||
|
--fcc-editable-region--
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Registration Form</title>
|
||
|
</head>
|
||
|
--fcc-editable-region--
|
||
|
<body>
|
||
|
</body>
|
||
|
</html>
|
||
|
```
|