HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
  • Insights
  • Verify Certificate
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials
HTML5ANDCSS3 logoHTML5ANDCSS3Tools and Tutorials

HTML5andCSS3.org helps developers learn modern frontend skills with practical tutorials, production-ready snippets, and fast web tools built for everyday coding.

Quick Links

  • About Us
  • Contact Us
  • Privacy Policy
  • Copyright
  • Disclaimer

Top Tools

  • Try It Editor
  • JSON Formatter
  • CSS Minifier
  • HTML Minifier
  • Base64 Encoder / Decoder

Contact

  • business@html5andcss3.org
Newsletter

Learn at your own pace, practice with useful tools, and build websites you're proud of.

© 2011-2026 html5andcss3.org. All rights reserved.

How to Use

HTML Tutorial

HTML Basics

Introduction to HTMLHTML EditorsHTML StructureHTML Elements & AttributesHTML HeadingsHTML ParagraphsHTML FormattingHTML CommentsHTML Styles

HTML Text and Links

HTML Text FormattingHTML Quotations & CitationsHTML LinksHTML Email Links

HTML Lists and Tables

HTML ListsHTML TablesTable Styling & Borders

HTML Images and Media

HTML ImagesHTML Picture ElementHTML AudioHTML VideoHTML Embed & Object

HTML Forms

HTML Forms OverviewHTML Form ElementsHTML Input TypesHTML Input AttributesHTML Form AttributesHTML Form Validation

HTML Layout

HTML Block vs Inline ElementsHTML Div & SpanHTML Semantic Layout TagsHTML Iframes

Advanced HTML

HTML Entities & SymbolsHTML EmojisHTML Head Element TagsHTML Meta Tags for SEOHTML Responsive Design

HTML References

HTML5 New TagsDeprecated TagsHTML Global AttributesEvent AttributesComplete HTML Tag ListComplete HTML5 ElementsHTML Tutorial PDF
  1. Home
  2. /
  3. Tutorials
  4. /
  5. HTML Tutorial
  6. /
  7. HTML Structure

HTML Basics

HTML Structure

Every web page on the internet follows a specific HTML structure.
This structure defines how a browser reads and displays the page’s content - from the title at the top to the last paragraph at the bottom.
In this article you will learn about the basic structure of HTML.

What Is the Basic Structure of an HTML Document?

An HTML document is made up of elements (tags) that tell the browser what to show and how to organize it.

Here’s the basic skeleton of every HTML page:

HTML Basic Structure

html

<!DOCTYPE html>
<html>
  <head>
    <title>My Web Page</title>
  </head>
  <body>
    <h1>Welcome to My Website</h1>
    <p>This is a simple HTML document structure.</p>
  </body>
</html>

Let’s break this down step by step

<!DOCTYPE html> - Document Type Declaration

This line tells the browser that the page uses HTML5, the latest version of HTML.
It must always appear at the very top of every HTML document.

html

<!DOCTYPE html>

Without it, browsers might not interpret your page correctly.

<html> - Root Element

The <html> tag wraps all other elements and defines the start and end of the document

html

<html>
  ... all your content goes here ...
</html>

Everything you want to display on the webpage lives inside this tag.

<head> - Head Section

The <head> contains metadata (information about the page that isn’t shown directly on the webpage).
It usually includes:

  • The page title
  • Meta tags (description, keywords, viewport)
  • Links to CSS files or favicons
  • Scripts to run before the page loads

html

<head>
  <title>My First Page</title>
  <meta charset="UTF-8">
  <meta name="description" content="A simple HTML structure example">
</head>

<title> - Title Tag

The <title> tag sets the text that appears:

  • On the browser tab
  • As the page title in search results

html

<title>My Web Page</title>

<body> - Body Section

The <body> contains everything visible on your web page - like text, images, links, tables, and forms.

html

<body>
  <h1>Hello, World!</h1>
  <p>This is my first HTML page.</p>
</body>

Complete Example with Explanation

Here’s how a simple, complete HTML document looks:

HTML Example

html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Basic HTML Structure</title>
  </head>
  <body>
    <h1>Welcome to HTML Structure</h1>
    <p>This example shows the essential building blocks of an HTML document.</p>
  </body>
</html>
  • The <!DOCTYPE html> ensures HTML5 compatibility.
  • The <html> wraps the entire content.
  • The <head> defines page info.
  • The <body> holds the visible content.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

Conclusion

The structure of an HTML document forms the foundation of every web page.

Once you understand where each element belongs, building pages becomes much easier.

Always remember: the browser reads your HTML from top to bottom, so order matters!

PreviousHTML EditorsNextHTML Elements & Attributes