HTML5 Cheatsheet
HTML5
Web
Frontend
Markup
Complete reference for HTML5 elements, attributes, and modern web development features for creating semantic and accessible web pages.
Quick Reference
📄 Document Structure
Basic HTML5 document layout and meta elements
📝 Text & Formatting
Text formatting and semantic markup elements
📋 Forms & Tables
Interactive forms and data table structures
🎯 HTML5 Features
Modern semantic elements and multimedia support
Document Structure
HTML5 provides a clean document structure with semantic elements that improve accessibility and SEO.
Basic Document Template
HTML5 Document Declaration
Document Information Elements
Base URL for relative links
Internal styles
Meta information
External scripts
Internal scripts
External stylesheets
Favicon link
Basic Structure Elements
Headings (h1-h6)
Paragraph
Generic container
Inline container
Line break
Horizontal rule
Text Formatting
HTML5 provides both visual and semantic text formatting elements for better content structure and meaning.
Emphasis and Importance
Strong importance (bold)
Emphasis (italic)
Deleted text (strikethrough)
Inserted text
Specialized Text Elements
Preformatted text
Block quotation
Abbreviation
Contact information
Inline code
Short quotation
Subscript and superscript
Keyboard input
Small text
Links and Navigation
Links are fundamental to web navigation, connecting pages and enabling user interaction.
Link Types
External link
Internal page link
Email link
Phone link
Anchor link (same page)
Download link
Link with target
Images and Media
Image Element
Basic image
Responsive image
Image with figure caption
Lists
Lists help organize information in a structured, readable format.
List Types
Ordered list (numbered)
Unordered list (bulleted)
Description list
Forms
Forms are essential for user interaction and data collection. Always include proper validation and accessibility features.
Form Structure
Basic form
Form Attributes
Form with various attributes
Input Types
Text inputs
Date and time inputs
Other input types
Checkboxes and radio buttons
Form Controls
Textarea
Select dropdown
Buttons
Tables
Tables should be used for tabular data only. Use CSS Grid or Flexbox for layout purposes.
Table Structure
Complete table example
Column grouping
Objects and Embedded Content
Multimedia Elements
Object element
Iframe
Embed element
HTML5 Semantic Elements
HTML5 semantic elements provide meaning to your content structure, improving accessibility and SEO.
Layout Elements
Header section
Footer section
Main content area
Article content
Sidebar content
Section element
Navigation element
Interactive Elements
Details and summary
Dialog element
Content Elements
Figure with caption
Highlighted text
Progress indicator
Meter element
Time element
Text Direction Elements
Bidirectional isolation
Word break opportunity
Ruby Annotations
Ruby text for East Asian typography
Canvas and Graphics
Canvas Element
HTML5 Canvas
Image map
Character Entities
HTML entities allow you to display special characters that have meaning in HTML or are not available on standard keyboards.
Common HTML Entities
Special characters
Numeric entities
Best Practices
Follow these HTML5 best practices for creating semantic, accessible, and maintainable web content.
- Use semantic elements like
<header>
,<nav>
,<main>
,<article>
,<section>
, and<footer>
for better structure - Always include alt attributes on images for accessibility
- Use proper heading hierarchy (h1-h6) to create logical document outlines
- Include lang attribute on the html element for language identification
- Use form labels properly associated with input elements
- Validate your HTML using W3C Markup Validator
- Write semantic, not presentational HTML - use CSS for styling
- Include meta viewport tag for responsive design
- Use HTTPS for all external resources when possible
Learn More
Explore comprehensive HTML5 documentation and modern web development techniques
Written by
Deepak Jangra
Created At
Wed Jan 15 2025
Updated At
Fri Jun 13 2025