HTML Tags
Recommended With
| Tag | Description | Example |
|---|---|---|
| <html> | Root of HTML document | <html lang='en'>...</html> |
| — | ||
| <head> | Document metadata | <head><title>Title</title></head> |
| — | ||
| <title> | Browser tab title | <title>My Page</title> |
![]() | ||
| <body> | Main content | <body><p>Hi</p></body> |
| Hi | ||
| <meta> | Metadata | <meta charset='UTF-8'> |
| — | ||
| <link> | External resources | <link rel='stylesheet' href='style.css'> |
| — | ||
| <style> | Internal CSS | <style>body {color: red;} |
| — | ||
| <script> | JavaScript code | <script>alert('Hi')</script> |
| (click to runs JS) |
Text Content
| Tag | Description | Example |
|---|---|---|
| <h1> to <h6> | Headings | <h1>Main</h1> |
Main | ||
| <p> | Paragraph | <p>Hello</p> |
Hello | ||
| <br> | Line break | Line1<br>Line2 |
| Line1 Line2 | ||
| <hr> | Horizontal rule | <hr> |
| <pre> | Preformatted text | <pre> A\nB </pre> |
A | ||
| <blockquote> | Block quote | <blockquote>Quote</blockquote> |
Quote |
Lists
| Tag | Description | Example |
|---|---|---|
| <ul> | Unordered list | <ul><li>A</li></ul> |
| ||
| <ol> | Ordered list | <ol><li>1</li></ol> |
| ||
| <li> | List item | <li>Item</li> |
| <dl> | Description list | <dl><dt>HTML</dt><dd>Markup</dd></dl> |
|
Text Formatting
| Tag | Description | Example |
|---|---|---|
| <a> | Hyperlink | <a href="https://designfreaks.net">Designfreaks</a> |
| Designfreaks | ||
| <b> | Bold (styling) | <b>Bold</b> |
| Bold | ||
| <strong> | Strong importance | <strong>Bold</strong> |
| Bold | ||
| <em> | Emphasis | <em>Italic</em> |
| Italic | ||
| <i> | Italic (styling) | <i>Italic</i> |
| Italic | ||
| <u> | Underline | <u>Underlined</u> |
| Underlined | ||
| <s> | Strike through | <s>Striked</s> |
| <mark> | Highlight | <mark>Highlight</mark> |
| Highlight | ||
| <small> | Smaller text | <small>Note</small> |
| Small | ||
| <sub> | Subscript | H<sub>2</sub>O |
| H2O | ||
| <sup> | Superscript | x<sup>2</sup> |
| x2 | ||
| <code> | Inline code | <code>x = 1</code> |
x = 1 | ||
| <span> | Generic inline | <span>Text</span> |
| Text |
Media
| Tag | Description | Example |
|---|---|---|
| <img> | Image | <img src="https://image.png"> |
| <audio> | Audio | <audio controls src="file.mp3"></audio> |
| <video> | Video | <video controls src="file.mp4"></video> |
| <figure> | Media with caption | <figure><img><figcaption>Caption</figcaption></figure> |
| Figure with caption |
Forms & Inputs
| Tag | Description | Example |
|---|---|---|
| <form> | Form | <form action='/send'></form> |
| Wraps the form | ||
| <input> | Input field | <input type='text'> |
| <textarea> | Multiline input | <textarea></textarea> |
| <button> | Button | <button>Click</button> |
| <select> | Dropdown list | <select><option>1</option></select> |
| <label> | Label for input | <label for='id'>Label</label> |
Interactive
| Tag | Description | Example |
|---|---|---|
| <details> | Expandable details | <details><summary>More</summary>Text</details> |
MoreText | ||
| <summary> | Summary for <details> | <summary>Info</summary> |
| <dialog> | Dialog box | <dialog open>Hi!</dialog> |
| Dialog |
Semantic Layout
| Tag | Description | Example |
|---|---|---|
| <header> | Page or section header | <header>Welcome</header> |
| <nav> | Navigation links | <nav><a href='#'>Link</a></nav> |
| <main> | Main content area | <main>Stuff</main> |
| <section> | Thematic section | <section>Content</section> |
| <article> | Independent article | <article>Post</article> |
| <aside> | Sidebar content | <aside>Tip</aside> |
| <footer> | Footer section | <footer>End</footer> |
