← All cheat sheetsHTML cheat sheet
The HTML tags you use most, each with a small example. Click one to copy it.
Nothing matches your search.
Page structure
- Starting point for every page
- Load a stylesheet (in <head>)
- Load a script after the page is read
- Comment, not shown on the page
Text
- Headings h1 to h6; one h1 per page
- Paragraph
- Bold, with meaning (<b> without)
- Italic, with meaning (<i> without)
- Line break
- Quotation
- Inline code (<pre> for blocks)
- Thematic break (line)
Links and media
- Link
- Download link
- Open in a new tab
- Email link (tel:+62… for phone)
- Image; alt describes it, size prevents jumping
- Video with controls (<audio> works the same)
- Image with a caption
Lists
- Bulleted list
- Numbered list
- Terms and descriptions
Tables
- Table with a header row
- Cell across two columns (rowspan for rows)
- Table title, right after <table>
Forms
- Form
- Input with its label
- Input types; phones show a matching keyboard
- Checkbox (radio for one of many)
- Dropdown
- Multi-line text
- Hints and built-in checks
Semantic layout
- Top of the page or a section
- Main navigation links
- The main content, once per page
- Self-contained piece, like a post
- A themed group with a heading
- Side content
- Bottom of the page or a section
- Open/close section without JavaScript
Meta tags (in <head>)
- Search result description
- The main address of this page
- How the page looks when shared
- Browser tab icon
- Keep the page out of search results