HTML document structure
The doctype, html, head and body give a client’s page a recognizable document structure.
Leah opens a client's web page file to update it. The whole file is one line: an h1 heading that reads Custom Furniture. What else belongs in a complete HTML file?
4 minutes. No sign-up needed.
What you'll learn5 ideas
- The doctype,
<!DOCTYPE html>, goes at the very top of the file and tells the browser to use modern HTML rules. - Browsers fill in missing structure on their own, so a page that looks fine doesn't prove its file is complete.
- The html element starts right after the doctype and closes at the end, with every other element between its tags.
- The head element holds information for the browser, and the body element holds everything visitors see.
- Inside html, head comes first and body right after it, with neither one inside the other.