Essential HTML

A Guided Tutorial Using Hangman-Stg2

This page explains the essential HTML features used in our Hangman-Stg2 project. You'll see how tags, elements, and attributes work together to build a modern, responsive web app—especially when combined with Bootstrap 5 for styling.

1. The Basic Structure

Every HTML document starts with a <!DOCTYPE html> declaration, followed by the <html> element. The <head> contains metadata, links to stylesheets, and the page title. The <body> contains all visible content.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Hangman Stage 1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="..." rel="stylesheet">
  </head>
  <body>
    ...content...
  </body>
</html>

2. Head Section: Metadata & Styles

3. Body Section: Layout & Content

The <body> contains all the visible elements. Bootstrap's .container class centers and adds padding to your content.

<body class="bg-light">
  <div class="container py-5">
    <h1 class="text-center mb-4">Hangman Game - Stage 1</h1>
    ...
  </div>
</body>

4. Common HTML Elements Used

<div id="wordDisplay" class="display-4 text-center mb-3"></div>
<div id="letterButtons" class="d-flex flex-wrap justify-content-center mb-3"></div>
<button id="resetBtn" class="btn btn-primary">Restart Game</button>
<a href="hangmanChatlogStg1.html" class="btn btn-outline-secondary">View AI Chatlog</a>

5. Attributes: IDs, Classes, and More

6. Bootstrap 5: Responsive & Stylish

Bootstrap classes like container, btn, text-center, mb-4, and display-4 make your page look modern and work well on all devices. Outline button classes like btn-outline-secondary give interactive feedback on hover.

<button class="btn btn-primary">Restart Game</button>
<a class="btn btn-outline-secondary" href="hangmanChatlogStg1.html">View AI Chatlog</a>

7. Navigation & Linking Between Pages

Use <a> tags to link between your game, chatlog, and tutorial pages. You can style these links as buttons for a better user experience.

<a href="hangmanStg1a.html" class="btn btn-outline-light btn-sm">Game</a>
<a href="hangmanChatlogStg1.html" class="btn btn-outline-light btn-sm">AI Chatlog</a>

8. Additional HTML Features in Stage 2

As our project grows, we incorporate more HTML features to enhance structure, readability, and content presentation. Here are some notable additions in Stage 2:

9. Test Your Understanding

HTML (HyperText Markup Language) is the backbone of almost every webpage you visit. It provides the fundamental structure and meaning to web content by using a system of tags and attributes. Understanding HTML is the first and most crucial step in web development, as it forms the skeleton upon which CSS (for styling) and JavaScript (for interactivity) build. Without HTML, there would be no web pages as we know them—no text, no images, no links, no forms, just a blank canvas. Mastering HTML allows you to create well-organized, accessible, and search-engine-friendly websites.

Ready to see how well you've grasped these concepts?

Test Your HTML Knowledge!

10. Putting It All Together

By combining these HTML elements, attributes, and Bootstrap classes, you create a clean, interactive, and responsive web app. Explore the game and chatlog to see these features in action!

Tip: View the page source (Ctrl+U or right-click > "View Page Source") to see all the HTML in context.
↑ Top ↓ Bottom