HTML Structure & Document Skeleton
Every website you browse starts with a standard HTML document skeleton. HTML stands for HyperText Markup Language, and it provides the raw structure and meaning of web content. Before writing content like paragraphs or buttons, you must set up the foundational container elements that web browsers expect.
The Basic Skeleton
A modern HTML5 document begins with the <!DOCTYPE html> declaration. This is not a tag itself, but an instruction telling the browser to render the page using standard HTML5 mode. Immediately following this declaration is the root <html> element, which wraps every piece of code on the page.
Inside <html>, the document splits into two main sections:
<head>: Contains metadata, configurations, links to stylesheets, and the page<title>. This information is read by search engines and browsers, but it does not display directly on the visible web page.<body>: Contains all visible user-facing elements, such as headings, text, media, links, and layout containers.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to Web Development</h1>
<p>This content is visible to website visitors.</p>
</body>
</html>
Why Structure Matters
Without a valid document skeleton, browsers must guess how to parse your tags, which causes layout quirks, broken character encodings, and accessibility failures. Setting up clean metadata in the <head> and placing all content in the <body> guarantees predictable behavior across modern desktop and mobile browsers.
Key takeaways
- Always start with
<!DOCTYPE html>to trigger standard HTML5 mode. - Use
<html>as the root element with a proper language attribute likelang="en". - Put metadata, scripts, and the document title inside
<head>. - Keep all visible web elements safely inside the
<body>.