> 文章列表 > 常用HTML标签检索表

常用HTML标签检索表

常用HTML标签检索表

标签 作用 例子
<!DOCTYPE> 定义文档类型。 <!DOCTYPE html>
<html> 定义HTML文档。 <html>\\n <head>\\n <title>网页标题</title>\\n </head>\\n <body>\\n <h1>这是一个网页标题</h1>\\n <p>这是网页内容</p>\\n </body>\\n</html>
<head> 定义HTML文档的头部。 <head>\\n <title>网页标题</title>\\n <meta charset="UTF-8">\\n</head>
<title> 定义文档的标题。 <title>网页标题</title>
<base> 定义页面中所有链接的默认地址或默认目标。 <base href="https://www.example.com/">
<link> 定义文档与外部资源之间的关系。 <link rel="stylesheet" href="style.css">
<meta> 定义文档的元数据。 <meta name="viewport" content="width=device-width, initial-scale=1.0">
<style> 定义HTML文档的样式表。 <style>\\n h1 {\\n color: red;\\n }\\n</style>
<script> 定义客户端脚本。 <script>\\n alert(“Hello World!”);\\n</script>
<body> 定义HTML文档的主体部分。 <body>\\n <h1>这是一个网页标题</h1>\\n <p>这是网页内容</p>\\n</body>
<div> 定义HTML文档中的对立区块。 <div class="container">\\n <p>这是一个对立区块</p>\\n</div>
<span> 定义HTML文档中的行内元素。 <span style="color: red;">这是行内文本</span>
<h1> - <h6> 定义标题级别。 <h1>这是一级标题</h1>\\n<h2>这是二级标题</h2>
<p> 定义段落。 <p>这是一个段落</p>
<a> 定义超链接。 <a href="https://www.example.com/">跳转到例子页面</a>
<img> 定义图像。 <img src="example.jpg" alt="例子图片">
<ul> 定义无序列表。 <ul>\\n <li>项目一</li>\\n <li>项目二</li>\\n</ul>
<ol> 定义有序列表。 <ol>\\n <li>项目一</li>\\n <li>项目二</li>\\n</ol>
<li> 定义列表中的项目。 <ul>\\n <li>项目一</li>\\n <li>项目二</li>\\n</ul>
<table> 定义表格。 <table>\\n <tr>\\n <th>标题1</th>\\n <th>标题2</th>\\n </tr>\\n <tr>\\n <td>数据1</td>\\n <td>数据2</td>\\n </tr>\\n</table>
<tr> 定义表格中的行。 <table>\\n <tr>\\n <th>标题1</th>\\n <th>标题2</th>\\n </tr>\\n <tr>\\n <td>数据1</td>\\n <td>数据2</td>\\n </tr>\\n</table>
<td> 定义表格中的单元格。 <table>\\n <tr>\\n <th>标题1</th>\\n <th>标题2</th>\\n </tr>\\n <tr>\\n <td>数据1</td>\\n <td>数据2</td>\\n </tr>\\n</table>
<th> 定义表格中的表头单元格。 <table>\\n <tr>\\n <th>标题1</th>\\n <th>标题2</th>\\n </tr>\\n <tr>\\n <td>数据1</td>\\n <td>数据2</td>\\n </tr>\\n</table>
<form> 定义交互表单。 <form action="/example" method="post">\\n <input type="text" name="name" placeholder="姓名">\\n <input type="email" name="email" placeholder="电子邮箱">\\n</form>
<input> 定义交互表单中的输入框。 <input type="text" name="name" placeholder="姓名">
<textarea> 定义交互表单中的多行文本输入框。 <textarea name="message" placeholder="留言内容">``</textarea>
<button> 定义交互表单中的按钮。 <button type="submit">提交</button>
<select> 定义交互表单中的下拉列表。 <select name="gender">\\n <option value="male"></option>\\n <option value="female"></option>\\n</select>
<option> 定义下拉列表中的选项。 <select name="gender">\\n <option value="male"></option>\\n <option value="female"></option>\\n</select>
<label> 定义交互表单中的标签。 <label for="name">姓名</label>\\n<input type="text" name="name" id="name">
<br> 定义换行。 <p>这是第一行<br>这是第二行</p>
<hr> 定义水平线。 <hr>
<nav> 定义导航链接。 <nav>\\n <a href="/">首页</a>\\n <a href="/about">关于我们</a>\\n <a href="/contact">联系我们</a>\\n</nav>
<header> 定义文档头部。 <header>\\n <h1>网站标题</h1>\\n</header>
<footer> 定义文档底部。 <footer>\\n <p>版权信息</p>\\n</footer>
<section> 定义文档中的文章或区域。 <section>\\n <h2>文章标题</h2>\\n <p>文章内容</p>\\n</section>
<article> 定义独立的文章内容。 <article>\\n <h2>文章标题</h2>\\n <p>文章内容</p>\\n</article>
<aside> 定义文章旁注内容。 <aside>\\n <h3>旁注标题</h3>\\n <p>旁注内容</p>\\n</aside>
<video> 定义视频。 <video src="example.mp4" controls>``</video>
<audio> 定义音频。 <audio src="example.mp3" controls>``</audio>
<iframe> 定义内联框架。 <iframe src="https://www.example.com/">``</iframe>
<svg> 定义矢量图形。 <svg width="100" height="100">\\n <circle cx="50" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />\\n</svg>
<canvas> 定义画布。 <canvas id="myCanvas" width="200" height="100">``</canvas>
<time> 定义日期或时间。 <time datetime="2020-01-01T00:00:00Z">2020年1月1日</time>
<address> 定义联系地址。 <address>\\n 中国上海市浦东新区张衡路3000号\\n</address>
<em> 定义强调文本。 <p>``<em>这是强调文本</em>``</p>
<strong> 定义重要文本。 <p>``<strong>这是重要文本</strong>``</p>