Semantic HTML &
Website Architecture
Good websites are more than collections of styled boxes. They have structure, meaning, and a clear organization. This week, you will learn how semantic HTML helps browsers, visitors, and assistive technologies understand the content of a webpage.
01 / Why Structure Matters
Imagine designing a poster with a title, subtitle, main image, supporting information, and a footer. Each part has a purpose. A website works in a similar way, except that HTML gives each part a structure that a browser can interpret.
In our earlier lessons, you used headings, paragraphs, lists, links, and images. This week, we will look at how those elements fit into a larger page structure.
02 / What Is Semantic HTML?
Semantic HTML means choosing elements that describe the meaning or purpose of the content they contain. Instead of using a generic container for everything, you choose elements that explain what each part of the page does.
Non-semantic element
A generic container such as <div> groups content but does not tell us what that content represents.
<div> <h2>About the Artist</h2> <p>Biography goes here.</p> </div>
Semantic element
An element such as <section> indicates that the content forms a distinct section of the page.
<section> <h2>About the Artist</h2> <p>Biography goes here.</p> </section>
Both examples can display the same content. The difference is that the semantic version communicates more about the role of the content within the document.
03 / Meet the Main Semantic Elements
These elements are commonly used to organize a webpage. You do not need to memorize every HTML element. Focus on understanding what these elements are for and when they make sense.
<header>
Introduces a page or a section. It might contain a site title, logo, heading, or introductory information.
<nav>
Contains a group of important navigation links that help visitors move through a website or page.
<main>
Contains the primary content of the page. A typical page should have one main content area.
<section>
Groups related content into a distinct thematic section, usually with its own heading.
<article>
Contains a self-contained piece of content, such as a news story, blog post, or independent feature.
<aside>
Contains related supporting information, such as a sidebar, related links, or a short supplemental note.
<footer>
Contains closing information for a page or section, such as credits, contact information, or copyright details.
<figure> and <figcaption>
Group an image or other illustrative content with an optional caption that explains or credits it.
04 / See How a Page Fits Together
Here is a simplified structure for an artist portfolio. Notice how the elements are nested to show the relationships between the page, its navigation, and its content.
<header> <h1>Jordan Lee — Artist</h1> <p>Photography, drawing, and mixed media.</p> </header> <nav> <a href="#about">About</a> <a href="#work">Work</a> <a href="#contact">Contact</a> </nav> <main> <section id="about"> <h2>About</h2> <p>A short artist biography.</p> </section> <section id="work"> <h2>Selected Work</h2> <figure> <img src="artwork.jpg" alt="Abstract artwork in blue and orange"> <figcaption>Artwork title, 2026.</figcaption> </figure> </section> <section id="contact"> <h2>Contact</h2> <p>Get in touch to learn more.</p> </section> </main> <footer> <p>© 2026 Jordan Lee</p> </footer>
Notice that the navigation links use href=”#about”, href=”#work”, and href=”#contact”. Each one matches the corresponding section’s id.
05 / The Difference Between Section and Article
Two elements that beginners sometimes confuse are <section> and <article>. They can both group content, but they serve different purposes.
Use a section when…
You are grouping related material into a thematic part of a larger page.
<section> <h2>Exhibition Information</h2> <p>Dates, location, and details.</p> </section>
Use an article when…
The content makes sense as a self-contained item, even outside the page around it.
<article> <h2>Artist Interview</h2> <p>An independent interview story.</p> </article>
There is no need to force every element into your page. Choose the element that best describes the content you actually have.
06 / Headings Create a Content Hierarchy
Headings do more than change the size of text. They organize information into levels, helping visitors understand how ideas relate to one another.
<h1>A Guide to Street Photography</h1> <section> <h2>Getting Started</h2> <p>Introduction to the subject.</p> <h3>Choosing a Camera</h3> <p>Information about camera choices.</p> </section> <section> <h2>Ethics and Respect</h2> <p>Information about photographing people.</p> </section>
07 / Basic CSS Still Does the Styling
Semantic elements work with the CSS skills you already know. You can select an element by its name and style it just as you have done with headings, paragraphs, and other HTML elements.
body { margin: 0; font-family: Arial, sans-serif; line-height: 1.6; color: #202638; } header { padding: 40px 24px; background-color: #111b35; color: white; } nav { padding: 16px 24px; background-color: #d7ff64; } nav a { margin-right: 16px; } main { max-width: 900px; margin: 0 auto; padding: 24px; } section { margin-bottom: 32px; } footer { padding: 24px; background-color: #f3f5fa; }
This is a basic example. You can use your own colors, type choices, and spacing. The important point is that HTML defines the content structure while CSS gives that structure its visual identity.
08 / Accessibility Starts with Structure
Semantic HTML can make a page easier to navigate and understand, including for people who use screen readers or other assistive technologies. Good structure also helps people who scan a page quickly.
- Use headings in a meaningful order.
- Use <nav> for important navigation groups.
- Place the primary page content inside <main>.
- Write descriptive link text that explains where a link goes.
- Give meaningful images appropriate alt text.
- Use an empty alt attribute, alt=””, for purely decorative images that do not convey information.
- Choose semantic elements for their purpose rather than their default appearance.
09 / In-Class Assignment: Rebuild the Structure
For this exercise, you will create a simple webpage for a fictional creative studio. Focus on meaningful HTML structure first. Keep the visual design simple; we will work with more advanced layout techniques in upcoming weeks.
Your page must include:
- A header containing a studio name and short introduction.
- A navigation area with three in-page links.
- A main content area with at least three sections.
- An article describing one featured project.
- An image with descriptive alt text and a caption.
- An aside containing a short related note or studio fact.
- A footer with a credit or contact detail.
Starter code
Paste this into the HTML panel in CodePen. Replace the sample text and add your own content. Then write CSS to style the page.
<header> <h1>Northstar Creative Studio</h1> <p>Ideas made visible.</p> </header> <nav> <a href="#studio">Studio</a> <a href="#project">Featured Project</a> <a href="#contact">Contact</a> </nav> <main> <section id="studio"> <h2>About the Studio</h2> <p>Describe your creative studio.</p> </section> <section id="project"> <h2>Featured Project</h2> <article> <h3>Project Title</h3> <p>Explain the project here.</p> <figure> <img src="project.jpg" alt="Describe your project image"> <figcaption>Project image caption.</figcaption> </figure> </article> <aside> <h3>Studio Note</h3> <p>Add an interesting related fact.</p> </aside> </section> <section id="contact"> <h2>Contact</h2> <p>Add contact information here.</p> </section> </main> <footer> <p>© 2026 Northstar Creative Studio</p> </footer>
10 / Independent Practice
After completing the starter exercise, review your Week 8 midterm website. You do not need to redesign the entire page. Instead, improve its underlying HTML structure.
- Review your existing code.
Identify generic containers and determine whether any would be better represented by semantic elements. - Organize your page.
Where appropriate, group the page using header, nav, main, section, article, aside, and footer elements. - Review your headings.
Make sure your main title and section headings create a logical hierarchy. - Check your images and links.
Verify that your alt text is useful, your captions are meaningful, and your link text explains its destination. - Preview the result.
Check that your changes have not broken your CSS or navigation. Semantic elements can be styled, but changing the HTML may affect selectors in your existing CSS.
11 / What to Submit
Submit the following through the designated D2L assignment area:
- A link to your completed in-class CodePen project.
- A screenshot showing the finished webpage.
- A short reflection of approximately 100–150 words explaining how semantic HTML improved the organization of your page.
Reflection questions
- Which semantic elements did you use, and what purpose did they serve?
- What is the difference between a generic <div> and a semantic element such as <section>?
- How can meaningful HTML structure help visitors understand and navigate a website?
12 / Final Checklist
- My page has a clear header, navigation, main content, and footer.
- My content is organized into meaningful sections.
- I used article and aside only where they make sense.
- My headings follow a logical hierarchy.
- My in-page navigation links work.
- My images have appropriate alt text and captions where needed.
- My CSS still works after I updated the HTML.
- I submitted my CodePen link, screenshot, and reflection.
Instructor walkthrough: Structure Before Style
Use this walkthrough during the live CodePen demonstration. Build the page in small steps, preview after each change, and ask students to predict what each element communicates. Keep the focus on HTML structure rather than advanced visual styling.
Remove this entire instructor-only section, including the comments, before publishing the student-facing lesson.
Step 1 — Start with a generic container
Show a basic block of content using a div. Explain that it groups content but does not tell us what the content represents.
<div> <h2>About the Studio</h2> <p>We create visual experiences.</p> </div>
Ask: What can we tell from this markup? What information does the element name itself give us?
Step 2 — Choose an element that describes the content
Replace the div with a section and point out that the content now has a clearer purpose. Mention that a section is most useful when it groups a distinct topic, usually with a heading.
<section> <h2>About the Studio</h2> <p>We create visual experiences.</p> </section>
Ask: Does this change necessarily make the content look different? If not, what has improved?
Step 3 — Assemble the page structure
Build the page using the major semantic elements. Explain each part as you add it: header introduces the site, nav groups navigation links, main contains the primary content, and footer provides closing information.
<header> <h1>Northstar Creative Studio</h1> </header> <nav> <a href="#studio">Studio</a> <a href="#contact">Contact</a> </nav> <main> <section id="studio"> <h2>About the Studio</h2> </section> <section id="contact"> <h2>Contact</h2> </section> </main> <footer> <p>© 2026 Northstar Creative Studio</p> </footer>
Ask: Why does main contain the primary page content, rather than the navigation or footer?
Step 4 — Demonstrate how in-page links work
Show that the value in an anchor’s href must match an element’s id. Then introduce a deliberate mismatch so the link stops reaching the intended section.
<a href="#studoi">Studio</a> <section id="studio"> <h2>About the Studio</h2> </section>
Ask students to spot the spelling difference, then correct href="#studoi" to href="#studio".
Ask: What other things could make a navigation link appear not to work?
Step 5 — Distinguish section from article
Use a portfolio example. A section groups the broader “Featured Work” topic; an article can contain one self-contained project description. Reinforce that element choice depends on the content, not on which element is easiest to style.
<section> <h2>Featured Work</h2> <article> <h3>Project One</h3> <p>A self-contained project description.</p> </article> </section>
Step 6 — Add CSS without confusing structure and appearance
Demonstrate that semantic elements can be styled with the same CSS skills students already know. Keep the CSS simple and explain that a semantic tag is not a layout system by itself.
body { font-family: Arial, sans-serif; line-height: 1.6; color: #202638; } header { padding: 24px; background-color: #111b35; color: white; }
Ask: Which part of this example determines what the content means, and which part determines how it looks?
Step 7 — Quick student check
- Students can explain why semantic HTML communicates more than a generic container.
- Students can identify the purpose of header, nav, main, section, article, aside, and footer.
- Students can explain how an in-page link matches an element ID.
- Students can distinguish a logical heading hierarchy from visual heading size.
- Students can describe one way semantic structure supports accessibility.