Home  >  Article  >  Web Front-end  >  HTML common tags

HTML common tags

WBOY
WBOYOriginal
2016-12-05 13:26:281737browse

Common HTML tags:

HTML document format:

First of all, HTML is a hypertext tag language, which is the basis for making web pages.

Secondly, the HTML document contains at least basic and paired , , , < ;/body>Double label.

Finally, the attribute tag is indispensable in HTML documents, describing some attributes of HTML web pages and converting character encodings. Generally, the international encoding utf-8 is chosen.

<span style="color: #008080"> 1</span> <span style="color: #0000ff"><span style="color: #ff00ff">DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 2</span> <span style="color: #0000ff"><span style="color: #800000">html </span><span style="color: #ff0000">xmlns</span><span style="color: #0000ff">="http://www.w3.org/1999/xhtml"</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 3</span> <span style="color: #0000ff"><span style="color: #800000">head</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 4</span>     <span style="color: #0000ff"><span style="color: #800000">meta </span><span style="color: #ff0000">http-equiv</span><span style="color: #0000ff">="Content-Type"</span><span style="color: #ff0000"> content</span><span style="color: #0000ff">="text/html; charset=utf-8"</span> <span style="color: #0000ff">/></span>
<span style="color: #008080"> 5</span>     <span style="color: #0000ff"><span style="color: #800000">title</span><span style="color: #0000ff">></span>我是网页标题<span style="color: #0000ff"></span><span style="color: #800000">title</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 6</span> <span style="color: #0000ff"></span><span style="color: #800000">head</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 7</span>     <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 8</span> <span style="color: #000000">        我是网页内容。  
</span><span style="color: #008080"> 9</span>     <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080">10</span> <span style="color: #0000ff"></span><span style="color: #800000">html</span><span style="color: #0000ff">></span></span></span></span></span></span></span>

HTML document parsing:

1. root tag, which is the root tag of the HTML document, and all content on the page must be included .

2. Head tag, the document in it will not be displayed on the web page, the purpose is for the HTML common tagsowser to parse the attributes in it.

3. The title tag needs to be concise and concise, and can summarize the main content of a web page, that is, as the title of a web page.

4. content tag, which is also the content presented on the web page.

1. The most commonly used tags:

1.

...
Title tag ▷ Set the title text in the web page. After setting, it will be displayed in black and bold. The code and effect are as follows:

<span style="color: #008080"> 1</span> <span style="color: #0000ff"><span style="color: #800000">html</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 2</span> <span style="color: #0000ff"><span style="color: #800000">head</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 3</span>     <span style="color: #0000ff"><span style="color: #800000">meta </span><span style="color: #ff0000">http-equiv</span><span style="color: #0000ff">="Content-Type"</span><span style="color: #ff0000"> content</span><span style="color: #0000ff">="text/html; charset=utf-8"</span> <span style="color: #0000ff">/><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204204948381-163635024.png" alt=""  style="max-width:90%"  style="max-width:90%"></span></span></span></span>
<span style="color: #008080"> 4</span>     <span style="color: #0000ff"><span style="color: #800000">title</span><span style="color: #0000ff">><span style="color: #000000">PB_</span></span>6大标题类型<span style="color: #0000ff"></span><span style="color: #800000">title</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 5</span> <span style="color: #0000ff"></span><span style="color: #800000">head</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 6</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 7</span>     <span style="color: #0000ff"><span style="color: #800000">h1</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h1</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 8</span>     <span style="color: #0000ff"><span style="color: #800000">h2</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h2</span><span style="color: #0000ff">></span>
<span style="color: #008080"> 9</span>     <span style="color: #0000ff"><span style="color: #800000">h3</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h3</span><span style="color: #0000ff">></span>
<span style="color: #008080">10</span>     <span style="color: #0000ff"><span style="color: #800000">h4</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h4</span><span style="color: #0000ff">></span>
<span style="color: #008080">11</span>     <span style="color: #0000ff"><span style="color: #800000">h5</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h5</span><span style="color: #0000ff">></span>
<span style="color: #008080">12</span>     <span style="color: #0000ff"><span style="color: #800000">h6</span><span style="color: #0000ff">></span>我是标题h1<span style="color: #0000ff"></span><span style="color: #800000">h6</span><span style="color: #0000ff">></span> 
<span style="color: #008080">13</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080">14</span> <span style="color: #0000ff"></span><span style="color: #800000">html</span><span style="color: #0000ff">></span></span></span></span></span></span></span></span></span>
2, & lt; p & gt; & lt;/p & gt; paragraph label ▷ ▷ Set the paragraphs in the webpage, which can be nested, forms, etc., and will automatically change the line with the HTML common tagsowser size when multiple lines of text.

The code is as follows:

<span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">p</span><span style="color: #0000ff">></span>我是一个段落。<span style="color: #0000ff"></span><span style="color: #800000">p</span><span style="color: #0000ff">></span>
<span style="color: #008080">3</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span></span></span>

3.
Line HTML common tagseak tag   [Note] This is a single tag, without an end tag. The code and effect are as follows:

<span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080">2</span>   欢迎来到pengbo518博客园!<span style="color: #0000ff"><span style="color: #800000">HTML common tags </span><span style="color: #0000ff">/></span><span style="color: #000000"> 我是强制换行标签喔!<img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161203000631271-945862362.png" alt="HTML common tags"  style="max-width:90%"  style="max-width:90%"></span></span></span>
<span style="color: #008080">3</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>
4, & lt; hr /& gt; segmentation line label ▷ ▷ Set the segmentation line of the content in the webpage. [Note] This is also a single tag, without an end tag. The code

and the effect

are as follows:

<span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
<span style="color: #008080">2</span> <span style="color: #000000">     你是我的月亮
</span><span style="color: #008080">3</span>     <span style="color: #0000ff"><span style="color: #800000">hr </span><span style="color: #0000ff">/></span>
<span style="color: #008080">4</span> <span style="color: #000000">     我是地球<img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161203001938631-1115592738.png" alt=""  style="max-width:90%"  style="max-width:90%"></span></span></span>
<span style="color: #008080">5</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>
5.
Centering tag

▷ Set the position of the content in the web page so that the document is centered on the entire page.

1 body>
2     center>
3       我就在网页中间显示,你能怎么滴我?嗯哼
4     center>  
<span style="color: #008080">5</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

6、

    有序列表标签【注意】要套
  1. 列表项 使用。  ▷ 设置网页中的内容,使文档有序排列。代码及效果如下:

    <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
    <span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">ol</span><span style="color: #0000ff">></span>
    <span style="color: #008080">3</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第1列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
    <span style="color: #008080">4</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第2列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
    <span style="color: #008080">5</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第3列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
    <span style="color: #008080">6</span>     <span style="color: #0000ff"></span><span style="color: #800000">ol</span><span style="color: #0000ff">><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204204319599-592154556.png" alt=""  style="max-width:90%"  style="max-width:90%"></span></span></span></span></span></span>
    <span style="color: #008080">7</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

    7、

      无序列表标签【注意】要套
    • 列表项 使用。  ▷ 设置网页中的内容,使文档无序排列。代码及效果如下:

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">ul</span><span style="color: #0000ff">></span>
      <span style="color: #008080">3</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第1列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
      <span style="color: #008080">4</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第2列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
      <span style="color: #008080">5</span>         <span style="color: #0000ff"><span style="color: #800000">li</span><span style="color: #0000ff">></span>我是第3列<span style="color: #0000ff"></span><span style="color: #800000">li</span><span style="color: #0000ff">></span>
      <span style="color: #008080">6</span>     <span style="color: #0000ff"></span><span style="color: #800000">ul</span><span style="color: #0000ff">><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204204218693-875385495.png" alt=""></span></span></span></span></span></span>
      <span style="color: #008080">7</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

      8、

      自定义列表标签【注意】要套
      列表项使用。 ▷ 设置网页中的内容,使文档无序排列。代码及效果如下:

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">dl</span><span style="color: #0000ff">></span>
      <span style="color: #008080">3</span>         <span style="color: #0000ff"><span style="color: #800000">dt</span><span style="color: #0000ff">></span>我是自定义标题1<span style="color: #0000ff"></span><span style="color: #800000">dt</span><span style="color: #0000ff">><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204205523490-2070875690.png" alt=""></span></span></span></span>
      <span style="color: #008080">4</span>         <span style="color: #0000ff"><span style="color: #800000">dd</span><span style="color: #0000ff">></span>我是自定义描述1<span style="color: #0000ff"></span><span style="color: #800000">dd</span><span style="color: #0000ff">></span>
      <span style="color: #008080">5</span>         <span style="color: #0000ff"><span style="color: #800000">dt</span><span style="color: #0000ff">></span>我是自定义标题2<span style="color: #0000ff"></span><span style="color: #800000">dt</span><span style="color: #0000ff">></span>
      <span style="color: #008080">6</span>         <span style="color: #0000ff"><span style="color: #800000">dd</span><span style="color: #0000ff">></span>我是自定义描述2<span style="color: #0000ff"></span><span style="color: #800000">dd</span><span style="color: #0000ff">></span>
      <span style="color: #008080">7</span>     <span style="color: #0000ff"></span><span style="color: #800000">dl</span><span style="color: #0000ff">></span>
      <span style="color: #008080">8</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span></span></span></span>

      9、

       自定义格式标签         ▷ 自定义设置网页中的内容格式。代码及效果如下:

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>    <span style="color: #0000ff"><span style="color: #800000">pre</span><span style="color: #0000ff">></span>
      <span style="color: #008080">3</span> <span style="color: #000000">           您好!
      </span><span style="color: #008080">4</span> <span style="color: #000000">           欢迎您来到 pengbo518 博客园<img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204210310131-1915429582.png" alt=""></span></span></span>
      <span style="color: #008080">5</span> <span style="color: #000000">           感谢您对我的关注支持!
      </span><span style="color: #008080">6</span> <span style="color: #000000">           让我们共同学习探讨吧!      
      </span><span style="color: #008080">7</span>    <span style="color: #0000ff"></span><span style="color: #800000">pre</span><span style="color: #0000ff">></span>
      <span style="color: #008080">8</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

      10. Font shape label [bold] ▷ Set the font to be bold. The code and effect are as follows:

      11, Font shape tag [italic]                                                                                                          Set the font to appear in italics. The code and effect are as follows: 12、 Font shapeLabel [underline]

      Set font with Underlined. The code and effect are as follows:

      13、 Font shapeLabel [subscript] Set text as The subscript is displayed. The code and effect are as follows:

      14、 Font ShapeLabel [Superscript] Set text as Superscript is displayed. The code and effect are as follows:

           ** 10、11、12、13、14 **                    代码及效果集合如下:

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">b</span><span style="color: #0000ff">></span>《静夜思》<span style="color: #0000ff"></span><span style="color: #800000">b</span><span style="color: #0000ff">></span> 
      <span style="color: #008080">3</span>     <span style="color: #0000ff"><span style="color: #800000">sub</span><span style="color: #0000ff">></span>李白<span style="color: #0000ff"></span><span style="color: #800000">sub</span><span style="color: #0000ff">></span>
      <span style="color: #008080">4</span>     <span style="color: #0000ff"><span style="color: #800000">p</span><span style="color: #0000ff">></span>
      <span style="color: #008080">5</span>            <span style="color: #0000ff"><span style="color: #800000">i</span><span style="color: #0000ff">></span>床前明月光,疑是地上霜。<span style="color: #0000ff"></span><span style="color: #800000">i</span><span style="color: #0000ff">></span> <span style="color: #008080">6</span>           <span style="color: #0000ff"><span style="color: #800000">u</span><span style="color: #0000ff">></span>举头望明月,低头思故乡。<span style="color: #0000ff"></span><span style="color: #800000">u</span><span style="color: #0000ff">></span> </span></span></span></span></span></span>
      <em id="__mceDel"><span style="color: #008080">7</span>         <span style="color: #0000ff"><span style="color: #800000">sup</span><span style="color: #0000ff">></span>pengbo518<span style="color: #0000ff"></span><span style="color: #800000">sup</span><span style="color: #0000ff">></span>
      <span style="color: #008080">8</span>     <span style="color: #0000ff"></span><span style="color: #800000">p</span><span style="color: #0000ff">></span>
      <span style="color: #008080">9</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span></span></em>

      15、 字体标签                    设置字体、字号、颜色等。代码语法及效果如下:

             语法:文本

      <span style="color: #008080"> 1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080"> 2</span>    <span style="color: #0000ff"><span style="color: #800000">font </span><span style="color: #ff0000">size</span><span style="color: #0000ff">="+2"</span><span style="color: #ff0000"> face</span><span style="color: #0000ff">="Arial, Helvetica, sans-serif"</span><span style="color: #ff0000"> color</span><span style="color: #0000ff">="#FF0000"</span><span style="color: #0000ff">></span>
      <span style="color: #008080"> 3</span> <span style="color: #000000">       HTML I love you !
      </span><span style="color: #008080"> 4</span>    <span style="color: #0000ff"></span><span style="color: #800000">font</span><span style="color: #0000ff">><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204231516740-1821234010.png" alt=""></span></span></span>
      <span style="color: #008080"> 5</span>        <span style="color: #0000ff"><span style="color: #800000">HTML common tags </span><span style="color: #0000ff">/></span>
      <span style="color: #008080"> 6</span>    <span style="color: #0000ff"><span style="color: #800000">font </span><span style="color: #ff0000">size</span><span style="color: #0000ff">="+3"</span><span style="color: #ff0000"> face</span><span style="color: #0000ff">="隶书"</span><span style="color: #ff0000"> color</span><span style="color: #0000ff">="#0000FF"</span><span style="color: #0000ff">></span>
      <span style="color: #008080"> 7</span> <span style="color: #000000">       热爱生活,热爱博客园
      </span><span style="color: #008080"> 8</span>    <span style="color: #0000ff"></span><span style="color: #800000">font</span><span style="color: #0000ff">></span>     
      <span style="color: #008080"> 9</span> <span style="color: #0000ff"><span style="color: #800000">body<span style="color: #0000ff">></span></span></span>
      </span></span>

      16、HTML common tags 图像标签                                设置字体、字号、颜色等。代码语法及效果如下:

          语法:HTML common tags

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>    <span style="color: #0000ff"><span style="color: #800000">img </span><span style="color: #ff0000">src</span><span style="color: #0000ff">="images.png"</span><span style="color: #ff0000"> title</span><span style="color: #0000ff">="小鱼"</span><span style="color: #ff0000"> width</span><span style="color: #0000ff">="70px"</span><span style="color: #ff0000"> height</span><span style="color: #0000ff">="70px"</span><span style="color: #ff0000"> alt</span><span style="color: #0000ff">="鱼干"</span> <span style="color: #0000ff">/><img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161204232949302-201637373.png" alt=""></span></span></span>
      <span style="color: #008080">3</span> <span style="color: #000000">      我的小鱼干呢
      </span><span style="color: #008080">4</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

      17、超链接标签                           ▷ 创建超链接,href属性来设置页面的链接地址。代码语法及效果如下:

      <span style="color: #008080">1</span> <span style="color: #0000ff"><span style="color: #800000">body</span><span style="color: #0000ff">></span>
      <span style="color: #008080">2</span>     <span style="color: #0000ff"><span style="color: #800000">a </span><span style="color: #ff0000">href</span><span style="color: #0000ff">="http://www.baidu.com"</span><span style="color: #0000ff">></span>百度<span style="color: #0000ff"></span><span style="color: #800000">a</span><span style="color: #0000ff">></span><span style="color: #000000">||<img   style="max-width:90%" src="http://images2015.cnblogs.com/blog/1072336/201612/1072336-20161205001152240-1209790473.png" alt=""></span></span></span>
      3     a href="http://www.taobao.com">淘宝a>||
      4     a href="http://www.cnblogs.com">博客园a>
      <span style="color: #008080">5</span> <span style="color: #0000ff"></span><span style="color: #800000">body</span><span style="color: #0000ff">></span>

      【Supplement】1. File path: 1. Absolute path: Absolute path refers to the one with domain name or drive letter Complete route.

             2. Relative path: ▷ A relative path refers to the path relationship between the path of this file and other files (or folders). For example:

              If two are in the same folder, link in index.html pengbo518.html You can use the following method in index.html Link:

                      href=" pengbo518.html ">pengbo518 Blog Park

              If pengbo518.html The file is index.html The superior path of the file can be as follows in index.html Way links:       ">pengbo518 Blog Garden

          II. Anchor point:  ▷ Setting the anchor point is usually placed on a specific topic or at the top of the document. Then create an anchor link, through which you can quickly navigate to the specified location.

      当前 到 Link to the anchor point to the current document: & lt; a href = "#anchor point name" & gt; link text & lt;/a & gt;

                                                                                logue

    • 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