<p>.<p>This is a paragraph.</p>.<a href="https://example.com">.<nav> instead of <div class="nav">).Every HTML document follows a fundamental structure, or "boilerplate."
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document Title</title>
</head>
<body>
<!-- All visible content goes here -->
</body>
</html>
<!DOCTYPE html>: Declares the document type as HTML5. It must be the very first thing in your document.<html>: The root element that wraps all content on the page.<head>: Contains meta-information about the document, like the title, character set, styles, and scripts. This content is not displayed on the page.<body>: Contains all the visible content of the webpage, such as headings, paragraphs, images, and links.<tagname>Content goes here.</tagname>
<tagname attribute="value">Content.</tagname>
Example: <a href="https://www.google.com">Visit Google</a>
Some elements don't have content or a closing tag.
<tagname attribute="value">
Examples: <img src="photo.jpg" alt="A photo">, <br>, <hr>
| Result | Description | Entity |
|---|---|---|
| Non-breaking space | | |
| < | Less than | < |
| > | Greater than | > |
| & | Ampersand | & |
| © | Copyright | © |
.html extension (e.g., index.html).<head>, set your page <title>.<body>, structure your content using semantic HTML tags like <header>, <main>, and <footer>.<h1>, <p>), links (<a>), images (<img>), and lists (<ul>, <ol>).alt attribute on <img> tags for accessibility.Most modern code editors (like VS Code) have Emmet built-in. Type the abbreviation and press Tab.
!div#header → <div id="header"></div>p.intro → <p class="intro"></p>ul>li → <ul><li></li></ul>h1+p → <h1></h1><p></p>li*5 → five <li> tagsnav>ul>li*4>a creates a navigation menu with an unordered list and four list items, each containing a link.| Tag | Description |
|---|---|
| <h1> to <h6> | Heading levels, 1 is the most important. |
| <p> | Defines a paragraph. |
| <strong> | Defines important text (bolded by default). |
| <em> | Defines emphasized text (italicized by default). |
| <span> | An inline container for styling parts of text. |
| Tag | Description |
|---|---|
| <a> | Defines a hyperlink. Use the href attribute for the URL. |
| <img> | Embeds an image. Use src for the path and alt for descriptive text. |
| Tag | Description |
|---|---|
| <ul> | Defines an unordered (bulleted) list. |
| <ol> | Defines an ordered (numbered) list. |
| <li> | Defines a list item, used inside <ul> or <ol>. |
| Tag | Description |
|---|---|
| <header> | Container for introductory content or navigation links. |
| <nav> | Defines a set of navigation links. |
| <main> | Specifies the main, unique content of the document. |
| <section> | Defines a thematic grouping of content. |
| <article> | Defines self-contained, independent content (e.g., a blog post). |
| <footer> | Container for the footer of a document or section. |
| <div> | A generic container for styling and grouping (use only when no semantic tag is appropriate). |
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First Blog Post</title>
</head>
<body>
<header>
<h1>Understanding HTML</h1>
<nav>
<ul>
<li><a href="/home">Home</a></li>
<li><a href="/about">About</a></li>
</ul>
</nav>
</header>
<main>
<article>
<h2>The Building Blocks of the Web</h2>
<p>HTML is the foundation of every webpage. It consists of <strong>elements</strong> that structure the content.</p>
<img src="code_image.png" alt="Snippet of HTML code">
<p>Learning the basic tags is the first step to becoming a web developer.</p>
</article>
</main>
<footer>
<p>© 2025 My Awesome Blog. All rights reserved.</p>
</footer>
</body>
</html>
<div> without a </div>) or improperly nested tags (e.g., <b><i>text</b></i>). Use your browser's Developer Tools (F12 or Ctrl+Shift+I) to inspect the DOM and find errors.src attribute. Is it spelled correctly? Is it relative or absolute? Open the "Network" tab in Developer Tools to see if the browser is getting a "404 Not Found" error for the image.