McTweak.ai

Learning to code through chaos and comedy

Chapter 10, Edition 2

HTML Structure

Chapter 10, Edition 2 of 10 20% Complete

HTML Structure & Semantic Layout

Building the blueprint for your final project

The Blueprint Battles

AllyMcTweak

AllyMcTweak

Alright, I've reviewed all the final project proposals and... oh my. These are mostly disasters waiting to happen. Has anyone seen a student project with actual semantic structure?

TrashyMcTweak

TrashyMcTweak

Pssh! Semantic structure is for COWARDS! Real developers throw fifty nested <div> tags into a blender and let destiny sort it out! Kids these days need to EMBRACE CHAOS!

AllyMcTweak

AllyMcTweak

This is EXACTLY why no one lets you mentor the beginners anymore, Trashy. Last time you did, three students tried to make "interactive websites" using nothing but alert() popups.

CodyMcTweak

CodyMcTweak

I tried looking at some of the proposals too... one student made their entire site structure with tables inside tables inside tables. Like some kind of HTML Russian nesting doll.

GrumpyMcTweak

GrumpyMcTweak

TABLES?! TABLES?!! Do they think this is 1997? Next you'll tell me they're using <blink> tags and embedding MIDI files! THIS IS AN OUTRAGE! A CATASTROPHE! A COMPLETE BREAKDOWN OF MODERN WEB STANDARDS!

FattyMcTweak

FattyMcTweak

Did someone say tables? My premium clients LOVE tables. Tables inside flexboxes inside grids inside containers. That's how you justify the big bucks! More complexity means more money, people!

AshleyMcTweak

AshleyMcTweak

Has anyone considered the accessibility implications here? These structures are ADA lawsuits waiting to happen. Screen readers will burst into flames trying to navigate this mess.

TrashyMcTweak

TrashyMcTweak

One kid just submitted a wireframe that looks like they designed it while experiencing an earthquake. The navigation is in the FOOTER. The footer! And the main content is split into seventeen columns for no reason!

GarbageMcTweak

GarbageMcTweak

The solution is simple. Headers go in <header>. Content goes in <main>. Tangential information goes in <aside>. Navigation goes in <nav>. Footers go in <footer>. That's it.

AllyMcTweak

AllyMcTweak

Well yes, that's semantic HTML 101, but some of these projects are actually complex. They need proper wireframing and structural planning before a single tag gets written.

AshleyMcTweak

AshleyMcTweak

Besides, if they don't learn proper semantic structure now, they'll become the next generation of developers creating legally questionable sites that exclude users. And I have enough work already.

CodyMcTweak

CodyMcTweak

What if we teach them wireframing first? Like, physically drawing the layout with labeled semantic elements before they touch any code? That helped me when I was learning...

GrumpyMcTweak

GrumpyMcTweak

FINALLY! A SENSIBLE SUGGESTION! Start with STRUCTURE! PLANNING! ORGANIZATION! Not this fly-by-night, code-and-pray approach that's poisoning the industry! I've been saying this FOR DECADES!

FattyMcTweak

FattyMcTweak

Wireframing? That's what my design team charges extra for! But... I suppose teaching it couldn't hurt. Just don't tell my clients we're giving away premium knowledge for free.

SnowzieMcTweak

SnowzieMcTweak

*excited woofs*

AshleyMcTweak

AshleyMcTweak

Snowzie says she agrees with Cody. Also, apparently we should teach them about "ul-fetch" lists and "bark-downs"... I think she means unordered lists and markdowns.

GarbageMcTweak

GarbageMcTweak

Fine. Wireframing first, semantic HTML second. Structure before style. Function before form. Now if you'll excuse me, there's a side quest in Elden Ring that won't complete itself.

Why Semantic HTML Structure Matters

Before writing a single line of code for your final project, you need to plan your HTML structure. Proper semantic HTML isn't just about following rules—it's about creating websites that are:

Semantic Elements Explained

Semantic HTML elements clearly describe their meaning to both the browser and the developer. For example, <header> contains introductory content, <nav> contains navigation links, and <footer> typically contains author info, copyright data, etc.

Non-Semantic vs. Semantic HTML

<div class="header">
  <div class="logo">My Website</div>
  <div class="nav">
    <div class="nav-item"><a href="#">Home</a></div>
    <div class="nav-item"><a href="#">About</a></div>
    <div class="nav-item"><a href="#">Contact</a></div>
  </div>
</div>

<div class="content">
  <div class="article">
    <div class="title">Article Title</div>
    <div class="text">This is the main content...</div>
  </div>
  <div class="sidebar">
    <div class="widget">Sidebar content...</div>
  </div>
</div>

<div class="footer">
  <div class="copyright">© 2023 My Website</div>
</div>
TrashyMcTweak

TrashyMcTweak

Look at all those beautiful divs! It's like a family reunion of generic boxes!

GrumpyMcTweak

GrumpyMcTweak

THIS IS AN ABOMINATION! Screen readers will have a BREAKDOWN trying to interpret this! DO YOU WANT LAWSUITS? BECAUSE THIS IS HOW YOU GET LAWSUITS!

<header>
  <h1 class="logo">My Website</h1>
  <nav>
    <ul>
      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">Contact</a></li>
    </ul>
  </nav>
</header>

<main>
  <article>
    <h2>Article Title</h2>
    <p>This is the main content...</p>
  </article>
  <aside>
    <section class="widget">Sidebar content...</section>
  </aside>
</main>

<footer>
  <p>© 2023 My Website</p>
</footer>
AllyMcTweak

AllyMcTweak

Now this is clean! Each element describes exactly what it contains. Screen readers will love this structure.

GarbageMcTweak

GarbageMcTweak

Efficient. Logical. Structured. HTML as it was meant to be.

Key Semantic Elements

Element Purpose Example Use Case
<header> Introductory content or navigational aids Site logo, title, navigation menu
<nav> Section with navigation links Main menu, sidebar navigation, pagination
<main> Main content of the document The central content area (only one per page)
<article> Self-contained composition Blog post, news story, forum post
<section> Standalone section of content Chapters, tabbed content areas
<aside> Content tangentially related to main content Sidebars, pull quotes, advertising
<footer> Footer for nearest sectioning element Copyright info, site map, related links
<figure> & <figcaption> Self-contained content with optional caption Images, diagrams, code snippets with descriptions
CodyMcTweak

CodyMcTweak

I like to think of semantic HTML as giving the browser clues about what kind of content is in each section. It helps both humans and machines understand your page structure!

Wireframing: Planning Your Structure

Wireframing is a critical step before writing any HTML. It helps you plan your page structure, hierarchy, and content placement without getting distracted by design details.

What is a Wireframe?

A wireframe is a simple visual representation of your web page that shows:

  • Layout structure
  • Content organization
  • Information hierarchy
  • Functional elements
  • Basic user flow

Why Wireframe First?

Wireframing before coding helps you:

  • Focus on structure without distraction
  • Identify potential usability issues early
  • Plan semantic HTML elements appropriately
  • Get stakeholder feedback before investing in code
  • Create a roadmap for development
AshleyMcTweak

AshleyMcTweak

Pro tip: Label your wireframe elements with the semantic HTML tags you'll use. It makes the development phase much more straightforward and helps ensure accessibility from the start.

Wireframing Methods

Pen and Paper

The quickest method to sketch initial ideas and layouts. Ideal for early brainstorming.

✏️📝
Digital Tools

Software like Figma, Adobe XD, or Balsamiq for more detailed and shareable wireframes.

💻🖱️
HTML Prototypes

Create simple HTML structures with minimal CSS as an interactive wireframe.

🏗️🧩

Common Wireframing Mistakes

  • Adding too much detail (colors, fonts, exact images)
  • Not labeling sections with semantic HTML elements
  • Ignoring mobile/responsive layouts
  • Skipping wireframing and jumping straight to code
  • Not considering user flow between pages
TrashyMcTweak

TrashyMcTweak

Fine, FINE! Even I admit wireframing is useful. Just don't expect me to draw inside the lines. My wireframes have ENERGY! PASSION! QUESTIONABLE STRUCTURAL INTEGRITY!

Interactive Wireframe Example

This interactive demo shows how a wireframe translates to semantic HTML structure. Explore the regions to see the corresponding semantic elements.

<header> - Site Header & Logo

<nav> - Main Navigation

Home About Services Contact

<main> - Main Content Area

<article> - Primary Content

Article Title

Featured Image

<section> - Content Section

Section Content

Section Content

<aside> - Sidebar

Widget Area

<footer> - Page Footer

FattyMcTweak

FattyMcTweak

Not bad for a basic wireframe. For my premium clients, I'd add at least three more layers of complexity and charge accordingly. Maybe some nested carousels inside tab panels inside accordions...

GrumpyMcTweak

GrumpyMcTweak

ABSOLUTELY NOT! NESTED CAROUSELS ARE THE DEVIL'S PLAYGROUND! One logical structure! Clear hierarchies! NO CAROUSEL INCEPTION!

Activity: Create Your Project Wireframe

Your Task

For your final project, create a comprehensive wireframe that includes:

  1. At least 2-3 page layouts (home page + additional pages)
  2. Mobile and desktop versions of each layout
  3. Labels for all semantic HTML elements
  4. Notes on content hierarchy and user flow

Choose Your Method

Option 1: Hand-Drawn

Draw your wireframes on paper, take clear photos, and upload them to your project folder.

Option 2: Digital Tools

Use a wireframing tool like Figma, Balsamiq, or Miro and export your designs as images.

When You're Done

Share your wireframes with at least one classmate for feedback before starting to code your HTML structure.

SnowzieMcTweak

SnowzieMcTweak

*excited woofs with tail wagging*

AshleyMcTweak

AshleyMcTweak

Snowzie says she'll be reviewing all wireframes personally. She has very strong opinions about navigation placement and treats highly accessible designs with special... consideration.

Key Takeaways

Structure Before Style

Always plan your HTML structure before thinking about CSS styling. A solid semantic foundation makes everything else easier.

Semantic Elements

Use HTML5 semantic elements like <header>, <nav>, <main>, and <footer> instead of generic <div> tags whenever possible.

Wireframing

Create wireframes to plan your layout and structure before writing code. Label elements with their semantic HTML tags.

Accessibility

Proper semantic HTML makes your site more accessible to screen readers and other assistive technologies.

GarbageMcTweak

GarbageMcTweak

Remember: Structure is not just about what works today. It's about what will still work after three framework changes, five redesigns, and countless content updates. Build to last.

Code is Committed!

SnowzieMcTweak

SnowzieMcTweak Approves!

Proper structure makes for happy users and happy Elkhounds.

Remember: God is good, hug your Elkhound.