HTML Fundamentals — Structure & Semantic Elements
⏱ 12 min read read
HTML (HyperText Markup Language) defines the structure and content of every web page. HTML5 introduced semantic elements that give meaning to your structure — not just visual appearance.
Block vs Inline Elements:
Block elements start on a new line and take the full width available: <div>, <p>, <h1>–<h6>, <section>, <article>, <ul>, <li>.
Inline elements sit inside text and only take as much space as needed: <span>, <a>, <strong>, <em>, <img>.
Semantic HTML5 Elements:
<header> — page or section header
<nav> — navigation links
<main> — the primary content of the page (only one per page)
<section> — a thematic grouping of content
<article> — self-contained content (blog post, news item)
<aside> — sidebar or supplementary content
<footer> — page or section footer
Why semantics matter:
Screen readers use semantic elements to help blind users navigate.
Search engines weight semantic content more heavily for SEO.
Your code becomes self-documenting and easier to maintain.
Links and Images:
<a href="page.html"> — links to another page (relative)
<a href="https://google.com" target="_blank"> — opens in new tab
<img src="photo.jpg" alt="Description"> — ALWAYS include alt text!
IMPORTANT: The alt attribute is not optional. It is required for accessibility and SEO.
Lists:
<ul> — unordered list (bullet points)
<ol> — ordered list (numbered)
<li> — list item (used inside both)
Forms — The Gateway to Interactivity:
<form action="/submit" method="POST">
<input type="text"> — text field
<input type="email"> — email field with built-in validation
<input type="password"> — hidden text
<input type="checkbox"> — tick box
<select> — dropdown
<textarea> — multi-line text
<button type="submit"> — submit the form
ALWAYS pair every input with a <label> — it improves accessibility and usability.
Block vs Inline Elements:
Block elements start on a new line and take the full width available: <div>, <p>, <h1>–<h6>, <section>, <article>, <ul>, <li>.
Inline elements sit inside text and only take as much space as needed: <span>, <a>, <strong>, <em>, <img>.
Semantic HTML5 Elements:
<header> — page or section header
<nav> — navigation links
<main> — the primary content of the page (only one per page)
<section> — a thematic grouping of content
<article> — self-contained content (blog post, news item)
<aside> — sidebar or supplementary content
<footer> — page or section footer
Why semantics matter:
Screen readers use semantic elements to help blind users navigate.
Search engines weight semantic content more heavily for SEO.
Your code becomes self-documenting and easier to maintain.
Links and Images:
<a href="page.html"> — links to another page (relative)
<a href="https://google.com" target="_blank"> — opens in new tab
<img src="photo.jpg" alt="Description"> — ALWAYS include alt text!
IMPORTANT: The alt attribute is not optional. It is required for accessibility and SEO.
Lists:
<ul> — unordered list (bullet points)
<ol> — ordered list (numbered)
<li> — list item (used inside both)
Forms — The Gateway to Interactivity:
<form action="/submit" method="POST">
<input type="text"> — text field
<input type="email"> — email field with built-in validation
<input type="password"> — hidden text
<input type="checkbox"> — tick box
<select> — dropdown
<textarea> — multi-line text
<button type="submit"> — submit the form
ALWAYS pair every input with a <label> — it improves accessibility and usability.
Log in to track your progress and earn badges as you complete lessons.
Log In to Track Progress