HTML 标签

文档结构

<!DOCTYPE html>Declares HTML5 document type
<html lang="en">Root element with language
<head>Metadata container
<body>Visible page content
<meta charset>Character encoding (UTF-8)
<meta viewport>Responsive viewport settings
<title>Page title in browser tab
<link rel>External resource link (CSS, icon)
<script>Embedded or external JavaScript
<noscript>Fallback for no-JS browsers

文本与内容

<h1>-<h6>Heading levels 1 through 6
<p>Paragraph of text
<a href="">Hyperlink to another page
<strong>Bold / important text
<em>Italic / emphasized text
<br>Line break
<hr>Horizontal rule / divider
<blockquote>Block-level quotation
<code>Inline code snippet
<pre>Preformatted text block
<span>Inline container for styling
<abbr>Abbreviation with tooltip

表单

<header>Intro content or nav group
<nav>Navigation links container
<main>Main content of the page
<article>Self-contained content piece
<section>Thematic content grouping
<aside>Sidebar or tangential content
<footer>Footer for section or page
<figure>Image with optional caption
<figcaption>Caption for a <figure>
<details>Collapsible disclosure widget
<summary>Visible heading for <details>
<time>Machine-readable date/time

媒体与嵌入

<ul>Unordered (bulleted) list
<ol>Ordered (numbered) list
<li>List item
<dl>Description list
<dt> / <dd>Term / description pair
<table>Table container
<thead> / <tbody>Table head / body groups
<tr>Table row
<th>Table header cell
<td>Table data cell

语义化标签

<form>Form container element
<input type="text">Single-line text input
<input type="email">Email input with validation
<input type="password">Masked password input
<input type="checkbox">Checkbox toggle
<input type="radio">Radio button selection
<input type="file">File upload input
<input type="range">Slider control
<textarea>Multi-line text input
<select> / <option>Dropdown selection list
<button>Clickable button element
<label>Label for form control

Form Attributes

requiredField must be filled
placeholderHint text inside input
disabledDisables the input
readonlyRead-only, not editable
autofocusAuto-focus on page load
patternRegex validation pattern
min / maxNumeric range limits
maxlengthMax character count

Media & Embed

<img src="" alt="">Image with alt text
<video controls>Video player with controls
<audio controls>Audio player with controls
<source>Media source for video/audio
<canvas>Drawing surface for JS
<svg>Scalable vector graphics
<iframe>Embeds external page
<picture>Responsive image container

Global Attributes

idUnique identifier
classCSS class name(s)
styleInline CSS styles
titleTooltip text
data-*Custom data attribute
hiddenHides element
tabindexTab order number
roleARIA role for a11y
aria-labelAccessible label
contenteditableMake editable
allprintabledoc.com