What is HTML? Tags, Attributes, & Document Anatomy
Every webpage you visit on the internet—from Google and Wikipedia to YouTube and Thinkora—is built on a foundation called HTML (HyperText Markup Language).
If a website were a building:
- HTML is the foundation, concrete pillars, and brick walls (the structure).
- CSS is the paint, windows, furniture, and lighting (the visual design).
- JavaScript is the electrical wiring, plumbing, and elevators (the interactivity).
1. How the Web Works
When you type a URL like https://thinkora.com into your browser:
- Your browser sends a request across the internet to a web server.
- The server responds with plain text files: HTML, CSS, and JavaScript.
- Your browser reads (parses) the HTML tags and renders them into visual text, images, and buttons on your screen.
2. The Anatomy of an HTML Element
HTML is composed of elements. Most elements have three parts:
- Opening Tag: Declares the start of the element (e.g.
<p>). - Content: The actual text, image, or nested element inside.
- Closing Tag: Declares the end of the element with a forward slash (e.g.
</p>).
┌─────────────── Opening Tag (with attribute)
│ ┌──────── Content
│ │ ┌────── Closing Tag
┌─┴──┐┌──┴───┐ ┌──┴─┐
<p class="intro">Namaste World!</p>
│ │
│ └────── Attribute Value
└────────────── Attribute Name
Attributes: Giving Elements Superpowers
Attributes supply extra information and configuration to tags. They always appear inside the opening tag and follow the format:
class="primary": Adds an identifier for styling with CSS.id="main-nav": Gives the element a unique identifier on the entire page.href="https://...": Tells a link where to navigate.
3. Interactive Tag & Document Anatomy Studio
Click on each piece of an HTML tag to inspect its technical role, and explore the complete standard HTML5 document skeleton.
HTML Anatomy & Document Anatomy Studio
Beginner FoundationInspect how tags, attributes, and full HTML document skeletons work under the hood.
Anatomy of an HTML Element
An HTML element consists of an Opening Tag (with optional attributes), the Content, and a Closing Tag. Click each piece below to inspect its purpose.
Tells the browser what kind of element this is. An anchor tag (<a>) creates a hyperlink that users can click to navigate to other pages.
4. The HTML5 Document Skeleton Explained
Every standard HTML file (index.html) requires five essential architectural tags:
<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My First Webpage</title> </head> <body> <h1>Welcome to My Website</h1> <p>This is where visible content lives!</p> </body></html>1. <!DOCTYPE html>
Tells the browser to render the page using the modern HTML5 standard rather than legacy 1990s quirks mode.
2. <html lang="en">
The root container that wraps all content on the page. The lang attribute tells search engines and screen readers what human language the page is written in.
3. <head>
Holds metadata for machines and browsers. Nothing inside <head> is rendered on the visible canvas (except the <title> which appears in the browser tab).
4. <body>
The visible canvas! Everything users see, read, and click—headings, paragraphs, images, videos, and buttons—lives inside <body>.
5. Void (Self-Closing) Elements
While most elements require a closing tag, some elements cannot hold content. These are called Void Elements and do not have closing tags:
<img>: Embeds an image (<img src="photo.jpg" alt="A photo">)<input>: Creates a form text field (<input type="text">)<br>: Inserts a simple line break<hr>: Draws a horizontal dividing line
6. Live Interactive HTML & CSS Playground
Experiment with real code in real-time below! Modify tags, edit text, or switch to the CSS tab to style elements on the fly:
Your First HTML & CSS Sandbox
Live SandboxTry typing new <h1>, <p>, or <button> tags into index.html and watch your browser preview update immediately.
7. Flashcards & Core Concepts
What is the difference between <head> and <body> in HTML?
What are void (self-closing) elements in HTML?
, ) cannot have content inside them and therefore do not have a closing tag.