Challenge - 5 Problems
HTML Structure Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Identify the correct root element of an HTML5 document
Which tag is the correct root element that must wrap all other elements in a valid HTML5 document?
Attempts:
2 left
💡 Hint
Think about the tag that contains both the <head> and <body> sections.
✗ Incorrect
The <html> tag is the root element of an HTML5 document. It wraps the entire content including <head> and <body>.
📝 Syntax
intermediate2:00remaining
What error occurs if the <head> tag is missing in an HTML document?
Consider this HTML snippet missing the <head> tag. What is the most likely outcome when rendered in a modern browser?
HTML
<!DOCTYPE html> <html> <body> <h1>Hello</h1> </body> </html>
Attempts:
2 left
💡 Hint
Browsers are forgiving and try to display content even if some tags are missing.
✗ Incorrect
Modern browsers automatically handle missing <head> tags and render the content inside <body> normally.
❓ rendering
advanced2:00remaining
What is the visual output of this HTML document?
Given the following HTML code, what will the user see in the browser?
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Test Page</title> </head> <body> <header> <h1>Welcome</h1> </header> <main> <p>This is a test.</p> </main> <footer> <p>Footer text</p> </footer> </body> </html>
Attempts:
2 left
💡 Hint
All semantic tags like <header>, <main>, and <footer> display their content by default.
✗ Incorrect
The browser renders all visible content inside semantic tags. The heading, paragraph, and footer text appear as normal text.
❓ selector
advanced2:00remaining
Which CSS selector targets the <main> element inside the <body>?
Given this HTML structure, which CSS selector correctly selects the <main> element?
<body>
<header></header>
<main></main>
<footer></footer>
</body>
Attempts:
2 left
💡 Hint
The > symbol means direct child in CSS selectors.
✗ Incorrect
The selector 'body > main' selects the <main> element that is a direct child of <body>.
❓ accessibility
expert2:00remaining
Which attribute improves accessibility by specifying the language of the document?
In an HTML document, which attribute should be added to the root <html> tag to help screen readers and browsers understand the language?
Attempts:
2 left
💡 Hint
This attribute uses a short code like 'en' for English.
✗ Incorrect
The 'lang' attribute on the <html> tag specifies the document language, helping screen readers and search engines.