HTML: The Foundational Guide for Every Developer

SiddarthaSiddartha
5 min read

A definitive bookmark-worthy deep dive into HTML β€” its purpose, structure, elements, and philosophy. Whether you're just starting out or brushing up your fundamentals, this guide is designed to anchor your understanding at the core. Share it with someone starting HTML or refer back any time you need clarity.


What is HTML?

HTML (HyperText Markup Language) is the backbone of the web. It's not a programming language; it's a markup language that provides both the content and the structure of that content, which you see displayed in your browser.

  • HyperText: Text that links to other documents or resources

  • Markup: The annotation of content with tags

HTML is the content layer in a web page. Paired with:

  • CSS β†’ presentation (look and feel)

  • JavaScript β†’ behavior (interactivity)

πŸ’‘ Even modern JS frameworks like React ultimately manipulate HTML under the hood.


🧠 Why HTML Still Matters in 2025

  • It's the root of semantic, accessible web development

  • It's critical for SEO, screen readers, and structured data

  • It's what JavaScript manipulates, and what CSS styles

No matter how advanced the tech stack, it all starts with HTML.


🌳 HTML as a Tree

HTML documents form a tree of nodes, known as the DOM (Document Object Model):

  • Element Nodes: Represent HTML tags

  • Text Nodes: Represent the textual content inside elements

Your browser parses the HTML and generates this live tree. JavaScript can then access and manipulate it.


πŸ”– Elements, Tags & Nesting

HTML consists of elements that are enclosed by tags written using angle brackets <>.

<h1>Hello, world!</h1>
  • <h1>: Opening tag

  • Hello, world!: Content

  • </h1>: Closing tag

  • Element: The entire block from opening tag to closing tag

βœ… Good Practices:

  • Always close your tags (even optional ones)

  • Nest elements properly (closing in reverse order)

  • Indent for readability

HTML is forgiving but don’t depend on it:

<ul>
  <li>Item 1
  <li>Item 2
</ul>

This works, but it's poor practice.


πŸ” Replaced vs Non-Replaced Elements

πŸ”΅ Non-Replaced Elements

These elements are part of the page’s document flow and can contain text or other elements:

  • <p>, <h1> β†’ contain text

  • <a>, <div>, <span> β†’ contain other elements

They’re not replaced by anything external. They define structure or inline meaning.

🟣 Replaced Elements

These are replaced by some visual content or UI element:

  • <img>, <input>, <video>, <iframe>, <object>

  • Their appearance is defined externally or by the browser (like form inputs)

<input type="range">
<img src="cat.png" alt="A cute cat">

These are injected into the page as interface components or media.


🚫 Void Elements (Self-Closing Tags)

Void elements are self-closing. They do not have content or a closing tag:

Examples:

  • <br> β†’ line break

  • <hr> β†’ horizontal rule

  • <img>, <input>, <meta>, <link>, <source>

<input type="text" placeholder="Name" />
<img src="logo.png" alt="Site Logo" />

πŸ”Έ The slash (/) at the end is optional, but improves readability (and is XHTML style).


πŸŽ›οΈ Attributes: Power Through Properties

HTML elements can have attributes: extra information provided inside the opening tag.

<img src="avatar.png" alt="User profile" width="100" height="100">
  • src: Source of the image

  • alt: Description for screen readers (and fallback)

  • width/height: Controls dimensions

πŸ“Œ Attribute Rules

  • Always quote attribute values ("value")

  • Use lowercase for attribute names

  • Boolean attributes (like checked, disabled) can be written without a value:

<input type="checkbox" checked>

🧠 While HTML is not case-sensitive, many attribute values are. Especially for id, class, and non-keyword strings.


🧠 HTML + JavaScript = DOM

The DOM (Document Object Model) is the live structure of the page.

As HTML is parsed, each tag becomes an object in memory that JavaScript can manipulate:

<p id="greeting">Hello</p>
document.getElementById("greeting").textContent = "Hi there!";

Everything in HTML becomes a node in the DOM:

  • Element Node: <p>, <div>, etc.

  • Text Node: plain text inside the element


🧩 Semantic HTML: Meaning Matters

Use semantic tags instead of just <div> and <span>.

Examples:

  • <header>, <footer>

  • <article>, <section>

  • <nav>, <aside>

They add meaning to your structure and:

  • Improve accessibility

  • Help with SEO

  • Make your HTML more readable

<header>
  <h1>101xDev Blog</h1>
</header>

πŸ“Œ Summary Cheat Sheet

TagPurpose
<p>Paragraph
<h1>-<h6>Headings
<a>Hyperlink
<ul>, <ol>, <li>Lists
<table>, <tr>, <td>Tables
<form>, <input>, <textarea>Forms
<img>Images
<div>, <span>Generic Containers
<header>, <footer>Page Structure

πŸ§ͺ Practice Challenge

Try building a simple profile page:

  • Add a title and header

  • A profile image (<img>) with alt text

  • A paragraph about yourself

  • A list of 3 favorite techs using <ul>

  • A contact input form

πŸ“Έ Share your output on social media with #101xDevs and tag your learning journey!

Do Follow us on @SidTechX


🧠 Final Thoughts

HTML is not just about making things "show up" on the screen β€” it's about creating structure with meaning.

Write HTML like you're writing a document meant to be understood by:

  • Browsers

  • Assistive technologies

  • Search engines

  • Other developers

Mastering HTML is the first real step in mastering the web.


πŸ“Œ Bookmark this post. Share it with a friend starting HTML

0
Subscribe to my newsletter

Read articles from Siddartha directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Siddartha
Siddartha