Basic Structure of an HTML Document

Himmat Kumar Apr 5, 2025, 12:40 PM
HTML
Views 1219
Blog Thumbnail

Each webpage on the internet begins with a basic HTML document or webpage. For us to utilize a browser, it is important to understand the life-giving anatomy structure of an HTML document.

HTML Document Building Blocks

πŸ—‚οΈ Doctype Declaration

This tag tells the web browser what version of HTML to expect in this document.

<!DOCTYPE html>

πŸ“¦ HTML Tag

The starting piece of any HTML document, at its core it's where every other component is nested.

<html lang="en">

  <!-- Everything goes here -->

</html>

πŸ‘‘ Head Section

It contains HTML meta tags along with the title of the webpage for indexing. By default, the title will be displayed on the top of the window.

🧍 Body Section

The Body Section usually contains the main content of the page such as headings, paragraphs, images, links etc.

<body>
  <h1>Hello World!</h1>
  <p>This is my first webpage.</p>
</body>

πŸ“ƒ Full Example

Showing only the β€œHello World!” example.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Welcome to My Web Page</title>
  </head>
  <body>
    <h1>Welcome to My Web Page</h1>
    <p>This is a basic HTML document structure.</p>
  </body>
</html>

πŸš€ Summary

With this basic structure you can create a snippet or a full website. In the end, having full control over your content is the key.

Comments

Please login to leave a comment.

No comments yet.

Related Posts

hyperlinks-and-media-embedding-2025
677 viewsHTML
Himmat Regar β€’ Jun 23, 2025, 4:37 PM

Hyperlinks & Media: Embedding Content the Right Way in ...

semantic-html-complete-guide
1415 viewsHTML
Himmat Regar β€’ Jun 9, 2025, 5:37 PM

Semantic HTML Explained: Why <header>-<footer> & Friend...

getting-started-with-html-setup-edit-run-code-in-browser
384 viewsHTML
Himmat Kumar β€’ Jul 25, 2024, 1:09 PM

Getting Started with HTML: Setup, Edit, and Run Your Co...

html-seo-faq-2025
630 viewsHTML
Himmat Regar β€’ Jun 23, 2025, 4:41 PM

HTML & SEO FAQ 2025: Answers to the Web’s Most-Asked Qu...

html-paragraph-tag-guide
1258 viewsHTML
Himmat Kumar β€’ Apr 8, 2025, 1:50 PM

HTML Paragraph Tag – Complete Guide with Examples

html-images-responsive-media-guide
1212 viewsHTML
Himmat Regar β€’ Jun 2, 2025, 6:46 PM

Images & Responsive Media in HTML – Formats, <picture>,...

html-css-js-online-compiler
394 viewsHTML
Himmat Regar β€’ May 30, 2025, 6:54 AM

HTML CSS JS Online Compiler – Best Free Tools to Code a...

what-is-html-full-explanation
502 viewsHTML
Himmat Kumar β€’ Oct 13, 2023, 11:40 PM

What is HTML? Full Explanation and Guide

modern-login-form-html-css
280 viewsHTML
Himmat Kumar β€’ Mar 4, 2025, 12:57 AM

Creating a Modern Login Form with HTML & CSS

responsive-meta-seo-friendly-markup-2025
529 viewsHTML
Himmat Regar β€’ Jun 23, 2025, 4:23 PM

Mastering Responsive Meta & SEO-Friendly Markup in 2025