HTML Coding Basics- Your First Steps in Web Development

What HTML Actually Is (And What It Isn't)

HTML stands for HyperText Markup Language. It's the skeleton of every webpage you've ever visited. No HTML, no website. That's just how it works.

But here's what most beginners get wrong: HTML isn't a programming language. It's a markup language. You use it to structure content, not build logic. If you want behavior—click handlers, animations, data processing—that's JavaScript's job.

HTML tells the browser what things are. This is a heading. This is a paragraph. This is a link. The browser figures out how to display it.

The Basic Structure of an HTML Document

Every HTML page follows the same basic template. Memorize this:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Your Page Title</title>
</head>
<body>
    <!-- Your content goes here -->
</body>
</html>

The <!DOCTYPE html> declaration tells the browser you're using modern HTML5. The <head> section holds metadata—things the browser and search engines need. The <body> section is where your visible content lives.

Essential HTML Tags You Need to Know

You don't need to memorize every HTML tag. You need to know these core ones:

Tags Always Come in Pairs (Mostly)

Most HTML tags have an opening tag and a closing tag. The closing tag has a forward slash before the tag name:

<p>This is a paragraph.</p>

Some tags are self-closing. These are called void elements:

Attributes: How You Configure Tags

Tags have attributes that provide additional information. They go inside the opening tag:

<a href="https://example.com" target="_blank" rel="noopener">Click me</a>

Common attributes:

Semantic HTML: Why It Matters

You can build an entire website using only <div> tags. It will work. But it's stupid.

Semantic HTML uses tags that describe their content's purpose:

Search engines weight content in semantic tags. Screen readers use them to help visually impaired users navigate. Your code becomes readable to other developers. There's no downside.

Common HTML Mistakes Beginners Make

These will bite you if you're not careful:

HTML5 Elements Comparison

Element Purpose Inline/Block Semantic
<div> Generic container Block No
<span> Inline text container Inline No
<article> Self-contained content Block Yes
<section> Thematic grouping Block Yes
<aside> Related content/sidebar Block Yes
<figure> Self-contained media with caption Block Yes

Your First HTML Page: Getting Started

Here's exactly what you do:

  1. Open Notepad (Windows) or TextEdit (Mac)
  2. Copy the basic HTML template above
  3. Save the file as index.html
  4. Open it in any browser by double-clicking

Now add some content inside the <body> tag:

<body>
    <header>
        <h1>My First Website</h1>
    </header>
    
    <main>
        <h2>About Me</h2>
        <p>I'm learning HTML and it's going fine.</p>
        
        <h3>My Skills</h3>
        <ul>
            <li>HTML basics</li>
            <li>Not much else yet</li>
        </ul>
        
        <img src="placeholder.jpg" alt="A placeholder image">
        
        <p>Want to know more? <a href="https://example.com">Visit my blog</a>.</p>
    </main>
    
    <footer>
        <p>© 2024 My Site</p>
    </footer>
</body>

Save and refresh your browser. That's it. You've built a webpage.

Where to Go From Here

HTML is the starting point, not the destination. You'll need:

MDN Web Docs (developer.mozilla.org) is the best HTML reference you'll find. Use it.

The Brutal Truth

HTML is easy. That's the point. You can learn the basics in a day. But good HTML—semantic, accessible, maintainable—that takes practice.

Most "HTML tutorials" teach you to slap divs everywhere and call it done. Don't do that. Learn semantic markup from the start. It's not harder, and it makes everything else easier.