freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-css-flexbox-by-buildi.../61537485c4f2a624f18d7794.md

1.9 KiB

id title challengeType dashedName
61537485c4f2a624f18d7794 Step 1 0 step-1

--description--

Inizia con il testo HTML standard. Aggiungi la dichiarazione DOCTYPE e gli elementi html, head e 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(/<!DOCTYPE\s+html/gi));

Dovresti chiudere la dichiarazione DOCTYPE con un carattere >.

assert(code.match(/<!DOCTYPE\s+html\s*>/gi));

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*>/));

La dichiarazione DOCTYPE dovrebbe essere all'inizio del tuo HTML.

assert(__helpers.removeHtmlComments(code).match(/^\s*<!DOCTYPE\s+html\s*>/i));

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--