HTML
This HTML cheatsheet provides a
This HTML cheatsheet covers all important HTML tags and their usage.
Basic Structure
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <!-- Your content goes here --> </body> </html>
Headings
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6>
Paragraphs & Text
<p>This is a paragraph.</p> <strong>Bold Text</strong> <em>Italic Text</em> <mark>Highlighted Text</mark> <small>Small Text</small>
Links
<a href="https://www.example.com" target="_blank">Visit Example</a> <a href="#section1">Internal Link</a>
Lists
Ordered List
<ol> <li>First item</li> <li>Second item</li> </ol>
Unordered List
<ul> <li>Item 1</li> <li>Item 2</li> </ul>
Description List
<dl> <dt>HTML</dt> <dd>HyperText Markup Language</dd> <dt>CSS</dt> <dd>Cascading Style Sheets</dd> </dl>
Images
<img src="image.jpg" alt="Description" width="300" height="200">
Tables
<table border="1"> <tr> <th>Name</th> <th>Age</th> </tr> <tr> <td>Alice</td> <td>25</td> </tr> </table>
Forms
<form action="/submit" method="post"> <label for="name">Name:</label> <input type="text" id="name" name="name" required> <label for="email">Email:</label> <input type="email" id="email" name="email" required> <input type="submit" value="Submit"> </form>
Input Types
<input type="text"> <input type="password"> <input type="email"> <input type="number"> <input type="date"> <input type="checkbox"> <input type="radio"> <input type="file"> <input type="range">
Semantic Tags
<header>Header Content</header> <nav>Navigation Links</nav> <main>Main Content</main> <section>Section Content</section> <article>Article Content</article> <aside>Sidebar Content</aside> <footer>Footer Content</footer>
Multimedia
Audio
<audio controls> <source src="audio.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio>
Video
<video width="320" height="240" controls> <source src="video.mp4" type="video/mp4"> Your browser does not support the video tag. </video>
Meta Tags
<meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Free HTML cheatsheet"> <meta name="keywords" content="HTML, HTML5, Web Development"> <meta name="author" content="Your Name">
HTML5 New Elements
<canvas id="myCanvas" width="200" height="100"></canvas> <figure> <img src="image.jpg" alt="Description"> <figcaption>Caption text</figcaption> </figure> <time datetime="2025-08-27">August 27, 2025</time> <progress value="70" max="100"></progress> <meter value="0.7">70%</meter>
Global Attributes
- id
- class
- style
- title
- hidden
- data-* (custom attributes)
- tabindex
- draggable
Iframes
<iframe src="https://www.example.com" width="600" height="400"></iframe>
Comments
<!-- This is a comment -->
Entities
- < : <
- > : >
- & : &
- " : "
- © : ©
- ® : ®