Compartir tecnología

La abreviatura y el nombre completo de las etiquetas HTML y sus correspondientes descripciones y ejemplos en chino.

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>HTML 标签简写及全称</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.951);
  12. }
  13. body {
  14. background: #2c3e50;
  15. }
  16. h1 {
  17. color: #f85f5faf;
  18. background-color: #1b657b4b;
  19. text-align: center;
  20. }
  21. p {
  22. color: #f85f5faf;
  23. }
  24. table.reference {
  25. width: 100%;
  26. border-collapse: collapse;
  27. }
  28. details {
  29. display: inline-block;
  30. color: chocolate;
  31. }
  32. table.reference th {
  33. background-color: #555;
  34. color: #ebf704;
  35. border: 1px solid #d4d4d4;
  36. font-size: 14px;
  37. padding: 3px;
  38. vertical-align: top;
  39. text-align: left;
  40. }
  41. table.reference tr:nth-child(odd) {
  42. background-color: #144756;
  43. }
  44. table.reference td {
  45. line-height: 2em;
  46. min-width: 24px;
  47. border: 1px solid #d4d4d4;
  48. color: hsla(160, 100%, 37%, 0.63);
  49. padding: 5px;
  50. vertical-align: top;
  51. }
  52. table.reference td:hover {
  53. color: #ebf704;
  54. box-shadow: inset -2px -2px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.6);
  55. }
  56. table.reference td:nth-child(1),
  57. table.reference td:nth-child(4),
  58. table.reference td:nth-child(7) {
  59. width: 1%;
  60. color: rgb(255, 250, 250);
  61. background-color: #144756;
  62. }
  63. </style>
  64. </head>
  65. <body>
  66. <div class="article-body">
  67. <div class="article-intro" id="content">
  68. <h1>HTML 标签简写及全称:表格内容将通过JavaScript动态生成</h1>
  69. <p>下表列出了 HTML 标签简写和全称及其对应的中文说明和实例:</p>
  70. <table class="reference" id="html-tags-table">
  71. <thead>
  72. <tr>
  73. <th>序号</th>
  74. <th>标签
  75. <details>
  76. <summary></summary>
  77. 实例
  78. </details>
  79. 中文说明
  80. </th>
  81. <th>英文全称</th>
  82. <th>序号</th>
  83. <th>标签
  84. <details>
  85. <summary></summary>
  86. 实例
  87. </details>
  88. 中文说明
  89. </th>
  90. <th>英文全称</th>
  91. <th>序号</th>
  92. <th>标签
  93. <details>
  94. <summary></summary>
  95. 实例
  96. </details>
  97. 中文说明
  98. </th>
  99. <th>英文全称</th>
  100. </tr>
  101. </thead>
  102. <tbody id="html-tags-tbody">
  103. <!-- 表格内容将通过JavaScript动态生成 -->
  104. </tbody>
  105. </table>
  106. </div>
  107. </div>
  108. <script>
  109. const tagsData = [
  110. { tag: 'a', fullName: 'Anchor', description: '锚点', example: '&lt;a href="https://www.baidu.com">百度&lt;/a>' },
  111. { tag: 'abbr', fullName: 'Abbreviation', description: '缩写词', example: '&lt;abbr title="abbreviation">abbr&lt;/abbr>' },
  112. { tag: 'acronym', fullName: 'Acronym', description: '取首字母的缩写词,HTML5 不支持 <acronym> 标签。请使用 <abbr> 标签代替它。', example: 'Can I get this &lt; acronym title="as soon as possible">ASAP &lt; /acronym>?' },
  113. { tag: 'address', fullName: 'Address', description: '地址', example: '&lt;address>地址&lt;/address>' },
  114. { tag: 'alt', fullName: 'alter', description: '替用(一般是图片显示不出的提示)', example: '&lt;img src="image.jpg" alt="图片加载失败">' },
  115. { tag: 'b', fullName: 'Bold', description: '粗体(文本)', example: '&lt;b>粗体&lt;/b>' },
  116. { tag: 'bdo', fullName: 'Bi-Directional Override', description: '文本显示方向', example: '&lt;bdo dir="rtl">文本显示方向&lt;/bdo>' },
  117. { tag: 'big', fullName: 'Big', description: '变大(文本)', example: '&lt;big>变大&lt;/big>' },
  118. { tag: 'blockquote', fullName: 'Block Quotation', description: '区块引用语', example: '&lt;blockquote>区块引用语&lt;/blockquote>' },
  119. { tag: 'br', fullName: 'Break', description: '换行', example: '&lt;p>段落&lt;br>换行&lt;/p>' },
  120. { tag: 'cell', fullName: 'cell', description: '巢', example: '&lt;table>&lt;tr>&lt;td>单元格1&lt;/td>&lt;td>单元格2&lt;/td>&lt;/tr>&lt;/table>' },
  121. { tag: 'cellpadding', fullName: 'cellpadding', description: '巢补白', example: '&lt;table>&lt;tr>&lt;td>单元格1&lt;/td>&lt;td>单元格2&lt;/td>&lt;/tr>&lt;/table>' },
  122. { tag: 'cellspacing', fullName: 'cellspacing', description: '巢空间', example: '&lt;table>&lt;tr>&lt;td>单元格1&lt;/td>&lt;td>单元格2&lt;/td>&lt;/tr>&lt;/table>' },
  123. { tag: 'center', fullName: 'Centered', description: '居中(文本)', example: '&lt;center>居中&lt;/center>' },
  124. { tag: 'cite', fullName: 'Citation', description: '引用', example: '&lt;cite>引用&lt;/cite>' },
  125. { tag: 'code', fullName: 'Code', description: '源代码(文本)' , example: '&lt;code>源代码&lt;/code>' },
  126. { tag: 'dd', fullName: 'Definition Description', description: '定义描述' , example: '&lt;dl>&lt;dt>定义术语&lt;/dt>&lt;dd>定义描述&lt;/dd>&lt;/dl>' },
  127. { tag: 'del', fullName: 'Deleted', description: '删除(的文本)' , example: '&lt;del>删除的文本&lt;/del>' },
  128. { tag: 'dfn', fullName: 'Defines a Definition Term', description: '定义定义条目', example: '&lt;dfn>定义定义条目&lt;/dfn>' },
  129. { tag: 'div', fullName: 'Division', description: '分隔' , example: '&lt;div>分隔&lt;/div>' },
  130. { tag: 'dl', fullName: 'Definition List', description: '定义列表', example: '&lt;dl>&lt;dt>定义术语&lt;/dt>&lt;dd>定义描述&lt;/dd>&lt;/dl>' },
  131. { tag: 'dt', fullName: 'Definition Term', description: '定义术语', example: '&lt;dl>&lt;dt>定义术语&lt;/dt>&lt;dd>定义描述&lt;/dd>&lt;/dl>' },
  132. { tag: 'em', fullName: 'Emphasized', description: '加重(文本)' , example: '&lt;em>加重的文本&lt;/em>' },
  133. { tag: 'font', fullName: 'Font', description: '字体', example: '&lt;font size="5">字体&lt;/font>' },
  134. { tag: 'h1~h6', fullName: 'Header 1 to Header 6', description: '标题1到标题6' , example: '&lt;h1>标题1&lt;/h1>&lt;h2>标题2&lt;/h2>&lt;h3>标题3&lt;/h3>&lt;h4>标题4&lt;/h4>&lt;h5>标题5&lt;/h5>&lt;h6>标题6&lt;/h6>' },
  135. { tag: 'hr', fullName: 'Horizontal Rule', description: '水平尺', example: '&lt;hr>' },
  136. { tag: 'href', fullName: 'hypertext reference', description: '超文本引用', example: '&lt;a href="https://www.baidu.com">百度&lt;/a>' },
  137. { tag: 'i', fullName: 'Italic', description: '斜体(文本)' , example: '&lt;i>斜体&lt;/i>' },
  138. { tag: 'iframe', fullName: 'Inline frame', description: '定义内联框架' , example: '&lt;iframe src="https://www.baidu.com" width="500" height="500">&lt;/iframe>' },
  139. { tag: 'ins', fullName: 'Inserted', description: '插入(的文本)', example: '&lt;ins>插入的文本&lt;/ins>' },
  140. { tag: 'kbd', fullName: 'Keyboard', description: '键盘(文本)', example: '&lt;kbd>键盘&lt;/kbd>' },
  141. { tag: 'li', fullName: 'List Item', description: '列表项目' , example: '&lt;ul>&lt;li>列表项目1&lt;/li>&lt;li>列表项目2&lt;/li>&lt;/ul>' },
  142. { tag: 'nl', fullName: 'navigation lists', description: '导航列表' , example: '&lt;nav>&lt;ul>&lt;li>导航项目1&lt;/li>&lt;li>导航项目2&lt;/li>&lt;/ul>&lt;/nav>' },
  143. { tag: 'ol', fullName: 'Ordered List', description: '排序列表' , example: '&lt;ol>&lt;li>列表项目1&lt;/li>&lt;li>列表项目2&lt;/li>&lt;/ol>' },
  144. { tag: 'optgroup', fullName: 'Option group', description: '定义选项组' , example: '&lt;select>&lt;optgroup label="组1">&lt;option value="1">选项1&lt;/option>&lt;option value="2">选项2&lt;/option>&lt;/optgroup>&lt;optgroup label="组2">&lt;option value="3">选项3&lt;/option>&lt;option value="4">选项4&lt;/option>&lt;/optgroup>&lt;/select>' },
  145. { tag: 'p', fullName: 'Paragraph', description: '段落' , example: '&lt;p>段落&lt;/p>' },
  146. { tag: 'pre', fullName: 'Preformatted', description: '预定义格式(文本 )', example: '&lt;pre>预定义格式&lt;/pre>' },
  147. { tag: 'q', fullName: 'Quotation', description: '引用语' , example: '&lt;q>引用语&lt;/q>' },
  148. { tag: 'rel', fullName: 'Reload', description: '加载' , example: '&lt;a href="https://www.baidu.com" rel="nofollow">百度&lt;/a>' },
  149. { tag: 's/ strike', fullName: 'Strikethrough', description: '删除线' , example: '&lt;s>删除线&lt;/s>' },
  150. { tag: 'samp', fullName: 'Sample', description: '示例(文本)' , example: '&lt;samp>示例&lt;/samp>' },
  151. { tag: 'small', fullName: 'Small', description: '变小(文本)' , example: '&lt;small>变小的文本&lt;/small>' },
  152. { tag: 'span', fullName: 'Span', description: '范围' , example: '&lt;span>范围&lt;/span>' },
  153. { tag: 'src', fullName: 'Source', description: '源文件链接', example: '&lt;img src="image.jpg" alt="图片加载失败">' },
  154. { tag: 'strong', fullName: 'Strong', description: '加重(文本)' , example: '&lt;strong>加重的文本&lt;/strong>' },
  155. { tag: 'sub', fullName: 'Subscripted', description: '下标(文本)', example: '&lt;sub>下标&lt;/sub>' },
  156. { tag: 'sup', fullName: 'Superscripted', description: '上标(文本)' , example: '&lt;sup>上标&lt;/sup>' },
  157. { tag: 'td', fullName: 'table data cell', description: '表格中的一个单元格' , example: '&lt;table>&lt;tr>&lt;td>单元格1&lt;/td>&lt;td>单元格2&lt;/td>&lt;/tr>&lt;/table>' },
  158. { tag: 'th', fullName: 'table header cell', description: '表格中的表头', example: '&lt;table>&lt;tr>&lt;th>表头1&lt;/th>&lt;th>表头2&lt;/th>&lt;/tr>&lt;/table>' },
  159. { tag: 'tr', fullName: 'table row', description: '表格中的一行' , example: '&lt;table>&lt;tr>&lt;td>单元格1&lt;/td>&lt;td>单元格2&lt;/td>&lt;/tr>&lt;/table>' },
  160. { tag: 'tt', fullName: 'Teletype', description: '打印机(文本)', example: '&lt;tt>打印机&lt;/tt>' },
  161. { tag: 'u', fullName: 'Underlined', description: '下划线(文本)', example: '&lt;u>下划线&lt;/u>' },
  162. { tag: 'ul', fullName: 'Unordered List', description: '不排序列表' , example: '&lt;ul>&lt;li>列表项目1&lt;/li>&lt;li>列表项目2&lt;/li>&lt;/ul>' },
  163. { tag: 'var', fullName: 'Variable', description: '变量(文本)' , example: '&lt;var>变量&lt;/var>' }
  164. ];
  165. let html = '';
  166. for (let i = 0; i < 20; i++) {
  167. const item = tagsData[i];
  168. const nextItem = tagsData[i + 20];
  169. const nextItem2 = tagsData[i + 40];
  170. html += ` <tr>
  171. <td class="item">${i + 1}</td>
  172. <td class="tag">
  173. ${item.tag}
  174. <details>
  175. <summary></summary>
  176. ${item.example}
  177. </details>
  178. ${item.description}
  179. </td>
  180. <td class="fullName">${item.fullName}</td>
  181. <td class="item">${nextItem ? i + 21 : ''}</td>
  182. <td class="tag">
  183. ${nextItem ? nextItem.tag : ''}
  184. <details>
  185. <summary></summary>
  186. ${nextItem ? nextItem.example : ''}
  187. </details>
  188. ${nextItem ? nextItem.description : ''}
  189. </td>
  190. <td class="fullName">${nextItem ? nextItem.fullName : ''}</td>
  191. <td class="item">${nextItem2 ? i + 41 : ''}</td>
  192. <td class="tag">
  193. ${nextItem2 ? nextItem2.tag : ''}
  194. <details>
  195. <summary></summary>
  196. ${nextItem2 ? nextItem2.example : ''}
  197. </details>
  198. ${nextItem2 ? nextItem2.description : ''}
  199. </td>
  200. <td class="fullName">${nextItem2 ? nextItem2.fullName : ''}</td>
  201. </tr> `;
  202. }
  203. const tableBody = document.querySelector('#html-tags-tbody');
  204. tableBody.innerHTML = `<table>${html}</table>`;
  205. </script>
  206. </body>
  207. </html>