2.0 KiB
id | title | challengeType | dashedName |
---|---|---|---|
60b69a66b6ddb80858c51578 | Step 1 | 0 | step-1 |
--description--
Inizia impostando la struttura HTML di base. Aggiungi una dichiarazione <!DOCTYPE>
e un elemento html
. All'interno dell'elemento html
, aggiungi un elemento head
e un elemento body
.
--hints--
Il codice dovrebbe contenere il riferimento DOCTYPE
.
assert(code.match(/<!DOCTYPE/gi));
Dovresti includere uno spazio dopo il riferimento DOCTYPE
.
assert(code.match(/<!DOCTYPE\s+/gi));
Dovresti definire il tipo di documento come html
.
assert(code.match(/html/gi));
Dovresti chiudere la dichiarazione DOCTYPE
con un carattere >
.
assert(code.match(/html\s*>/gi));
La dichiarazione DOCTYPE
dovrebbe essere all'inizio dell'HTML.
assert(__helpers.removeHtmlComments(code).match(/^\s*<!DOCTYPE\s+html\s*>/i));
L'elemento html
dovrebbe avere un tag di apertura.
assert(code.match(/<html\s*>/gi));
L'elemento html
dovrebbe avere un tag di chiusura.
assert(code.match(/<\/html\s*>/));
Dovresti avere un tag head
di apertura.
assert(code.match(/<head\s*>/i));
Dovresti avere un tag head
di chiusura.
assert(code.match(/<\/head\s*>/i));
Dovresti avere un tag body
di apertura.
assert(code.match(/<body\s*>/i));
Dovresti avere un tag body
di chiusura.
assert(code.match(/<\/body\s*>/i));
Gli elementi head
e body
dovrebbero essere fratelli.
assert(document.querySelector('head')?.nextElementSibling?.localName === 'body');
L'elemento head
dovrebbe essere all'interno dell'elemento html
.
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head'));
L'elemento body
dovrebbe essere all'interno dell'elemento html
.
assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body'));
--seed--
--seed-contents--
--fcc-editable-region--
--fcc-editable-region--