HTML Cheat Sheet (Detailed)
1. Document Structure
<!DOCTYPE html> - Declares HTML5 document type
<html> - Root element
<head> - Metadata, links, title
<body> - Visible content
2. Common Tags
<h1> to <h6> - Headings
<p> - Paragraph
<a href="url"> - Anchor/link
<img src="[Link]" alt="desc"> - Image
<ul>, <ol>, <li> - Lists
<br>, <hr> - Line break, horizontal rule
3. Forms
<form> - Form wrapper
<input type="text|email|password|checkbox|radio|submit|file|date">
<textarea></textarea>
<select><option></option></select>
<button>Click</button>
<label for="id">Label</label>
4. Tables
<table>
<tr> - Table row
<th> - Table header
<td> - Table data cell
</table>
5. Media Tags
<img> - Image
<video controls><source src="video.mp4"></video>
<audio controls><source src="audio.mp3"></audio>
<iframe src="..."></iframe>
6. Semantic Elements
<header>, <nav>, <main>, <section>, <article>, <aside>, <footer>, <figure>
Improve SEO and accessibility.
HTML Cheat Sheet (Detailed)
7. Input Types
text, password, email, number, date, range, color, file, checkbox, radio, submit
8. Input Attributes
required, placeholder, value, readonly, disabled, maxlength, minlength, pattern, step, min, max
9. Meta Tags
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="...">
<meta name="author" content="...">
10. Links & Navigation
<a href="url">Link</a>
<a href="#section-id">Jump to section</a>
<nav> - Navigation container
11. Multimedia & Embeds
<embed src="[Link]" type="application/x-shockwave-flash">
<object data="[Link]" type="application/pdf"></object>
<iframe src="..."></iframe>
12. Global Attributes
class, id, style, title, lang, tabindex, hidden, draggable, data-*
13. HTML Entities
< < , > > , & & , " " , © © , (non-breaking space)
14. Accessibility
alt (images), aria-label, role, tabindex, <label> for form inputs
15. Deprecated Tags
<font>, <center>, <bgsound>, <marquee>, <u> - Use CSS instead.