Chapter 2: HTML - The Structure

HTML (HyperText Markup Language) is the undisputed skeleton of the internet. Every single website you visit, whether it's a simple blog or a massive web application like Netflix, is built on a foundation of HTML.

Many beginners rush through HTML because it looks "easy". They learn how to make text bold, how to create a link, and then immediately move on to CSS or JavaScript. This is a massive mistake. Writing bad HTML ruins your website's SEO and makes it completely inaccessible to disabled users.

Divitis: The Beginner's Disease

The most common mistake new developers make is using the <div> tag for absolutely everything. A div is a generic container. It means nothing to a web browser, and it means nothing to a search engine like Google.

<!-- Bad HTML (Divitis) -->
<div class="header">My Website</div>
<div class="nav">Home | About</div>
<div class="article">This is a post.</div>
<div class="footer">Copyright 2026</div>

Semantic HTML5: Writing Professional Code

In HTML5, we use Semantic Tags. These are tags that describe their meaning to both the browser and the developer. When Google's robots scan your website to decide where to rank you in search results, they look for these tags to understand what your website is actually about.

<!-- Professional Semantic HTML -->
<header>
  <h1>My Website</h1>
  <nav>
    <a href="/">Home</a>
  </nav>
</header>

<main>
  <article>
    <h2>Blog Post Title</h2>
    <p>This is a semantic paragraph.</p>
  </article>
</main>

<footer>Copyright 2026</footer>

Accessibility (a11y) Matters

Imagine navigating the web completely blind. Millions of users rely on Screen Readers—software that literally reads the HTML code out loud to them. If your website is just a giant pile of divs, the screen reader has no idea how to explain the page to the user.

The SEO Impact

Google heavily penalizes websites that have poor HTML structure. If you want your portfolio or project to show up on the first page of Google, you must use proper meta tags in your <head> (Title, Description) and structure your body text semantically.

Mini Task: Inspect The Masters

  1. Go to a high-quality website like Apple.com or GitHub.com.
  2. Right-click anywhere on the page and select "Inspect Element".
  3. Look through their HTML code. Notice how they use <section>, <nav>, and <footer> instead of just generic divs.
Continue to Chapter 3: CSS