“HTML vs HTML5” usually means pre-HTML5 documents (often XHTML-style) versus the living HTML standard. HTML5 introduced the short doctype, semantic landmarks, native media, new input types, canvas, and JavaScript APIs — and dropped the need for Flash and XML-style empty-tag slashes.
This HTML cheat sheet is written for people searching for a fast, accurate reference: students, junior developers, and teams shipping production software. Pin it, copy the snippets, and come back when syntax slips.
Quick reference
- Doctype: HTML5:
<!DOCTYPE html>. Older pages used long DTDs that triggered quirks if mistyped. - Mime: Serve
text/html. XHTMLapplication/xhtml+xmlis rare on public sites now. - Semantics: New landmarks:
header,nav,main,article,section,footer. - Media:
<video>and<audio>replace plugin embeds for common formats. - Forms: New types (
email,date,number,range) and attributes (required,placeholder). - Graphics:
<canvas>for scripted drawing; SVG remains for scalable vector markup. - APIs: Offline-unrelated: history, geolocation, web storage, fetch (later), and more — JS, not tags.
- Void tags:
<img>,<input>,<br>do not need/>in HTML.
Copy-paste examples
HTML5 vs old-style head
The short doctype and charset meta are the HTML5 document start. Skip XML namespaces on public HTML.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML5 page</title>
</head>
<body>
<video controls src="intro.mp4"></video>
</body>
</html>Common mistakes
- Calling every modern page “HTML5” as a buzzword while still using table layout and Flash.
- Serving XHTML syntax (
<br />, namespaces) and expecting XML error handling in browsers. - Using HTML5 input types without
name/labels and assuming they replace a backend. - Polyfilling nothing, then blaming “HTML5 support” for a missing
langor title.
FAQ
- Is HTML5 a separate language? No. HTML5 is the HTML standard as of that era; HTML continues as a living specification. You write HTML.
- Can I mix HTML4 tags with HTML5? Browsers parse one language. Old tags like
<b>still work. Prefer semantic tags for new markup.
- Did HTML5 replace JavaScript? No. HTML5 added tags and enabled APIs that JavaScript calls. Behavior is still JS (or WASM).
Related HTML cheat sheets
Build with this stack
When a cheat sheet is not enough — you need a production app, a student FYP, or a custom dashboard — ArpaNeuro builds custom web development and also sells ready-made source code. Request a quote and tell us the stack.
Browse software development services or the source code marketplace if you want a working codebase instead of starting from a blank file.