Quick Intro
- HTML is the web's markup language. It uses elements and attributes.
- Elements are void or empty (no content or children), non-replaced, or replaced (by objects).
- Attributes define element properties. Case-Insensitive for names but not values
- Whitespace outside tags are collapsed into 1.
- Entitites display special characters. e.g.
&
- UTF-8
- HTML5 requires and is inherited by linked JS and CSS files.
- expands 7-bit ASCII to 256 characters. Non-ASCII characters are represented as
%xx (hexadecimal) in URLs
data- attributes store metadata directly on elements. Useful for UI behavior, plugins, scripts
Document Structure & Metadata
<!doctype html>: document type is HTML5. It's a null element [ no closing tag]
<html lang='en'>: root element
<head>: Contains metadata and links to external resources
<base href="" target="">: Sets a base URL + default target for all relative URLs on page
<style media='print | tv'>: Embed styles directly in HTML.
Textual Content & Semantics
<hr>: thematic break or shift in topic
<abbr title="">: abbreviation (title = full form)
<dfn id=''>: term being defined by text, often used within <p> or <dd>
<q cite="url"> / <blockquote> cite="url">: quote with source
- can contain
<mark> elements to emphasize some stuff in quotes
<address>: contact details for nearest ancestor article or body