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

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

Aggiungi l'attributo lang al tag di apertura <html> impostando il suo valore su en.

--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 del 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*>|<html\s+lang\s*=\s*('|")en\1\s*>/gi));

L'elemento html dovrebbe avere un tag di chiusura.

assert(code.match(/<\/html\s*>/));

Il tag di apertura <html> dovrebbe avere l'attributo lang con il valore en.

assert(code.match(/<html\s+lang\s*=\s*('|")en\1\s*>/));

La dichiarazione DOCTYPE dovrebbe essere all'inizio dell'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 dentro l'elemento html.

assert([...document.querySelector('html')?.children].some(x => x?.localName === 'head'));

L'elemento body dovrebbe essere dentro l''elemento html.

assert([...document.querySelector('html')?.children].some(x => x?.localName === 'body'));

--seed--

--seed-contents--

--fcc-editable-region--

--fcc-editable-region--