Chapter 1 deck Chapter 2 deck Chapter 3 deck Chapter 4 deck Chapter 5 deck Chapter 6 deck Chapter 7 deck Chapter 8 deck Chapter 9 deck Chapter 10 deck Chapter 11 deck Chapter 12 deck Chapter 13 deck Chapter 14 deck

HTML4 vs HTML5: Doctype & Page Structure

5 slides · use ←/→ or Space to navigate, F for fullscreen.

Reading view

← Back to the full Chapter 4 deck

HTML4 vs HTML5: Doctype & Page Structure
Fullscreen for presentation · Print / PDF for a handout
1 / 5
Lesson

HTML4 vs HTML5: Doctype & Page Structure

What changed from HTML4/XHTML, the simplified doctype, and the new page skeleton.

HTML4 vs HTML5: Doctype & Page Structure

HTML4 vs HTML5 — Key Differences

FeatureHTML 4HTML 5
StructureGeneric <div> containersSemantic tags: <header>, <nav>, <article>, <section>, <aside>, <footer>
MediaRequires Flash / plug-insNative <audio> & <video> elements
SyntaxCannot handle inaccurate codeTolerant parser, graceful degradation
APIsTraditional DOM APIs onlyCanvas, Drag & Drop, Geolocation, Workers
Local storageCookies only (~4 KB)localStorage / sessionStorage (5 MB+)
FormsBasic input typesdate, email, url, range, color, and more
HTML4 vs HTML5: Doctype & Page Structure

Document Type Declarations

HTML 4.01 and XHTML required long, version-specific doctypes. HTML5 simplified it dramatically:

<!DOCTYPE html>

Easy to memorise, and version-independent — the same doctype works for the living standard.

HTML4 vs HTML5: Doctype & Page Structure

HTML5 Page Structure

The old way relied on generic containers with IDs:

<div id="header">...</div>
<div id="nav">...</div>
<div id="section">...</div>
<div id="aside">...</div>
<div id="footer">...</div>

HTML5 replaces them with meaningful elements:

<header>...</header>
<nav>...</nav>
<section>...</section>
<article>...</article>
<aside>...</aside>
<footer>...</footer>
HTML4 vs HTML5: Doctype & Page Structure

Activity — complete the code

Replace the old HTML4 containers with HTML5 equivalents.

<!-- Old HTML4 -->
<div id="header">...</div>
 
<!-- HTML5 -->
<>...</header>
 
<!-- Old HTML4 -->
<div id="footer">...</div>
 
<!-- HTML5 -->
<>...</footer>
 
<!-- Doctype -->
html>