HTML Basic
Every HTML page follows the same skeleton: a doctype declaration, a root <html> element, and two children — <head> for metadata and <body> for visible content.
The document skeleton
What goes where
| Section | Purpose | Typical contents |
|---|---|---|
<!DOCTYPE html> | Tell the browser to use HTML5 standards mode. | — |
<head> | Information about the page, not shown in it. | <title>, <meta>, <link>, <script> |
<body> | The actual content the user sees. | Headings, paragraphs, images, links, forms… |
Note: The
<!DOCTYPE> declaration is not a tag — it's a one-line instruction. Without it, browsers fall back to "quirks mode" and lay out the page differently.Example
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Basic</title>
</head>
<body>
<h1>HTML Basic</h1>
<p>This is a demo page for the "HTML Basic" lesson.</p>
</body>
</html>
Try it Yourself »
Exercise
Complete the page skeleton with the doctype and the root html element.
<
>
<head><title>Hi</title></head>
<body>Hello</body>
</html>
Doctype is one line at the very top.
Discussion
Loading…