search
HomeWeb Front-endHTML TutorialWhat tags does HTML have? A complete list of commonly used HTML tags

There are many tags in html, and each tag has different uses. The following article on php Chinese website will summarize the commonly used tags in html. Each tag will be followed by an example. Without further ado, let us Let’s take a look at the details.

##

Font tag, used to modify the text style in the display effect

text

size: Control the font size. Minimum 1 ~ maximum 7. If the setting range is not between 1 and 7, the setting is invalid

color: Control the font color. Use English settings (for example: red, blue...)

face: Control the font type. Only font types that exist in the system font library can be set

Example:

<body>
东边日出<font color="green" size="50" face="宋体">西边雨</font>
</body>

Effect:

What tags does HTML have? A complete list of commonly used HTML tags


Line breaks in the HTML source code will be automatically ignored by the browser when parsing.

Line break tag, used to display line breaks in the effect

Example:

竹枝词二首·其一<br/>
刘禹锡<br/><br/>
杨柳青青江水平,闻郎江上踏歌声。<br/>
东边日出西边雨,道是无晴却有晴。

Effect:

What tags does HTML have? A complete list of commonly used HTML tags

##

Paragraph tag is used to divide paragraphs in the display effect. And automatically add blank lines before and after the paragraph

align: The alignment of the paragraph content

The default is left, the content is left

Right

Center Centered

Example:

<p align="center">黄鹤楼送孟浩然之广陵</p>
<p >故人西辞黄鹤楼,</p><p align="right">烟花三月下扬州。</p>                
<p>孤帆远影碧空尽,</p><p align="right">唯见长江天际流。</p>

Effect:

What tags does HTML have? A complete list of commonly used HTML tags

##

Title tag, used to divide titles in the display effect

Among them,

is the largest,

Example

:

<h1 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h1>
<h2 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h2>
<h3 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h3>
<h4 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h4>
<h5 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h5>
<h6 id="念奴娇-赤壁怀古">念奴娇·赤壁怀古</h6>
Effect:

What tags does HTML have? A complete list of commonly used HTML tags

 

Multiple spaces in the HTML source code will eventually be merged into one in the effect.

Space symbol, used to display a blank position in the effect

Example:

php     中文网</br>
php   中文网
Effect:

What tags does HTML have? A complete list of commonly used HTML tags

HTML comments

are used to annotate the HTML source code and are not displayed in the HTML effect.

can only be seen in the source code, and there is no

format in the page display effect:

example :

<!--html标签-->
Effect

: It will not be displayed in the HTML effect display, and can only be seen in the source code

Picture tag

What tags does HTML have? A complete list of commonly used HTML tags

用于在页面效果中展示一张图片。

src:指明图片的路径。(必有属性)

图片路径的写法:

①内网路径:

绝对路径:文件在硬盘上的具体位置。【不建议使用】

例如:C:\ JavaWeb001_html\img\c_1.jpg

相对路径:从引入者所在目录出发。【建议使用相对路径】

例如:../img/c_1.jpg

../表示上一层目录

./表示当前目录

互联网路径:

必须前面加上http://

例如:http://www.baidu.com/xxx.jpg

width:图片宽度

height:图片的高度

宽度和高度的设置:

默认单位是px,像素。例如:width=”400”   其实设置的是 width=”400px”。固定设置方式

百分比设置。例如:width=”50%”。  是父标签的百分比。 动态改变的。

示例:

<img  src="/static/imghwm/default1.png"  data-src="../c_1.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%"/ alt="What tags does HTML have? A complete list of commonly used HTML tags" >
<img  src="/static/imghwm/default1.png"  data-src="../c_2.jpg"  class="lazy"      style="max-width:90%"/ alt="What tags does HTML have? A complete list of commonly used HTML tags" >

列表标签

    无序列表标签,用于在效果中定义一个无序列表

  • 列表条目项标签,用于在效果中定义一个列表的条目

      有序列表标签,用于在效果中定义一个有序列表

      示例:

      <ul>
              <li>古诗</li>
              <li>古词</li>
              <li>诗歌</li>
      </ul>

      效果:

      What tags does HTML have? A complete list of commonly used HTML tags

      示例:

      <ol>
              <li>古诗</li>
              <li>古词</li>
              <li>诗歌</li>
      </ol>

      效果:

      What tags does HTML have? A complete list of commonly used HTML tags

      超链接标签

      超链接标签,用于在效果中定义一个可以点击跳转的链接

      href:超链接跳转的路径 (必有属性)

      内网本机路径:相对路径和绝对路径

      互联网路径:http://地址

      本页:默认跳转到本页

      超链接正常工作:①a标签中必须有内容

      ②a标签必须有href属性

      示例:

      <a herf="http://www.php.cn/">php中文网</a>
      <a herf="demo html">demo</a>

      注意:

      ①a标签内容体,不仅仅是文字,也可以是其他内容,例如图片

      ②a标签的href属性,不仅仅可以链接到html上,也可以链接到其他文件上,例如图片

      示例:

      <a herf="demo html">
      <img  src="/static/imghwm/default1.png"  data-src="../img/c_1.jpg"  class="lazy"   / alt="What tags does HTML have? A complete list of commonly used HTML tags" >
      </a>

      示例:

      <a herf="../img/c_1.jpg" />链接到一张图片</a>

      表格标签

      表格标签,用于在效果中定义一个表格

      border:设置表格的边框粗细

      width:设置表格的宽度

      表格的行标签,用于在效果中定义一个表格行

      表格的单元格标签,用于在效果中定义一个表格行中的单元格

      表格的书写顺序:

      步骤1:定义一个表格

      步骤2:定义表格中的一行 

      步骤3:在表格一行中定义单元格

         内容就可以写在单元格中

      示例:

      <table>
      <tr>
      <td>姓名</td>
      <td>数学</td>
      </tr>
      <tr>
      <td>A</td>
      <td>100</td>
      </tr>
      </table>

      效果:

      What tags does HTML have? A complete list of commonly used HTML tags

      表格的表头单元格标签,用于在效果中定义一个表格行中的表头单元格

      和 唯一区别: 内容 居中加粗

      示例:

      <table boder="1px" width="100%">
      <tr>
      <th>姓名</th>
      <th>数学</th>
      </tr>
      <tr>
      <td>A</td>
      <td>100</td>
      </tr>
      </table>

      效果:

      What tags does HTML have? A complete list of commonly used HTML tags

      单元格合并

      或者 都有两个单元格合并属性:

      colspan:跨列合并单元格

      rowspan:跨行合并单元格

      合并步骤:

      确定合并哪几个单元格,确定是跨列合并还是跨行合并

      在第一个出现的单元格上书写 合并单元格属性

      合并几个单元格,属性值就书写几

      被合并的单元格必须删掉

      示例:

      <tr>
      <td conspan="2">1</td>
      <td>3</td>
      <td>4</td>
      </tr>

      示例:

      <tr><td rowspan="2">6</td>
      <td>7</td>
      <td>8</td>
      </tr>
      <tr>
      <td>12</td>
      <td>15</td>
      </tr>

      示例:

      <tr>
      <td conspan="2" rowspan="2">8</td>
      <td>11</td>
      </tr>
      <tr>
      <td>16</td>
      </tr>

      块标签

      行级的块标签,用于在效果中 一行上定义一个块,进行内容显示。

      span有多少内容,就会占用多大空间。

      Span不会自动换行

      适用于少量数据展示

      示例:

      <span>哈哈哈哈哈</span>
      <span>呵呵呵呵呵</span>

      效果:

      What tags does HTML have? A complete list of commonly used HTML tags

      块级的块标签,用于在效果中 定义一块,默认占满一行,进行内容的显示

      默认占满一行

      会自动换行

      适用于大量数据展示

      示例:

      <div>哈哈哈哈哈</div>
      <div>呵呵呵呵呵</div>

      效果:

       What tags does HTML have? A complete list of commonly used HTML tags

      框架标签

      框架标签:

      标签,是多个窗口页面整合在一起的一个集合(框架集)。每一个页面(框架)都是单独文档,需要使用子标签来确定页面的位置。通过列和行来确定整体布局,使用cols确定列数,使用rows确定行数。多个可以嵌套使用。

      和两个不能共存。

      rows属性和cols属性取值:值1,值2,值3,….. 一个值表示一行(列),多值使用逗号分隔,值可以是 10px、10% 等,最后一个值如果不想计算可以使用*匹配剩余量。

      框架子标签:

      标签,用于设置

      框架集中的一个页面(框架)。

      src属性:确定页面的路径

      noresize属性:框架分隔先不能移动

      target属性:确定需要显示的页面在何处显示

      相关文章推荐:

      html标签之meta标签_html/css_WEB-ITnose

      HTML常用标签

      The above is the detailed content of What tags does HTML have? A complete list of commonly used HTML tags. For more information, please follow other related articles on the PHP Chinese website!

    1. Statement
      The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
      Beyond HTML: Essential Technologies for Web DevelopmentBeyond HTML: Essential Technologies for Web DevelopmentApr 26, 2025 am 12:04 AM

      To build a website with powerful functions and good user experience, HTML alone is not enough. The following technology is also required: JavaScript gives web page dynamic and interactiveness, and real-time changes are achieved by operating DOM. CSS is responsible for the style and layout of the web page to improve aesthetics and user experience. Modern frameworks and libraries such as React, Vue.js and Angular improve development efficiency and code organization structure.

      What are boolean attributes in HTML? Give some examples.What are boolean attributes in HTML? Give some examples.Apr 25, 2025 am 12:01 AM

      Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values ​​need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

      How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

      HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

      HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

      HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

      HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

      The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

      The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

      The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

      HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

      The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

      The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

      The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

      See all articles

      Hot AI Tools

      Undresser.AI Undress

      Undresser.AI Undress

      AI-powered app for creating realistic nude photos

      AI Clothes Remover

      AI Clothes Remover

      Online AI tool for removing clothes from photos.

      Undress AI Tool

      Undress AI Tool

      Undress images for free

      Clothoff.io

      Clothoff.io

      AI clothes remover

      Video Face Swap

      Video Face Swap

      Swap faces in any video effortlessly with our completely free AI face swap tool!

      Hot Tools

      VSCode Windows 64-bit Download

      VSCode Windows 64-bit Download

      A free and powerful IDE editor launched by Microsoft

      Atom editor mac version download

      Atom editor mac version download

      The most popular open source editor

      ZendStudio 13.5.1 Mac

      ZendStudio 13.5.1 Mac

      Powerful PHP integrated development environment

      MinGW - Minimalist GNU for Windows

      MinGW - Minimalist GNU for Windows

      This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

      DVWA

      DVWA

      Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software