search
HomeWeb Front-endH5 TutorialDetailed explanation of HTML5 basic tags and SEO code examples

1.Hn tag, generally only one H1 tag is used in a page as the main information title, which is convenient for SEO.

2.P tag, paragraph tag.

3.Semanticization refers to using reasonable HTML tags and their unique attributes to format document content. In layman's terms, semantics is to process data and information so that machines can understand it.

In fact, one of the most effective methods for SEO is It is to reconstruct the HTML structure of the web page, which is essentially semantics.

4.


Horizontal line (in Webstorm: hr+Tab)


##

5. Text labelInline label

6. The tag is used to highlight a small part of the text

7. The HTML tag is only used to display the content. If you want to give it a style, You should consider using css.

8. subscript, such as: H2O The display of such content

##superscript, such as:

239.Hyperlink:

href

target

10.

##New tags added in HTML 5:

<article> 标记 定义一篇文章 
<aside> 标记 定义页面内容部分的侧边栏 
<audio> 标记 定义音频内容 
<canvas> 标记 定义图片 
<command> 标记 定义一个命令按钮 
<datalist> 标记 定义一个下拉列表 
<details> 标记 定义一个元素的详细内容 
<dialog> 标记 定义一个对话框(会话框) 
<embed> 标记 定义外部的可交互的内容或插件 
<figure> 标记 定义一组媒体内容以及它们的标题 
<footer> 标记 定义一个页面或一个区域的底部 
<header> 标记 定义一个页面或一个区域的头部 
<hgroup> 标记 定义文件中一个区块的相关信息 
<keygen> 标记 定义表单里一个生成的键值 
<mark> 标记 定义有标记的文本 
<meter> 标记 定义 measurement within a

predefined range:

<nav> 标记 定义导航链接 
<output> 标记 定义一些输出类型 
<progress> 标记 定义任务的过程 
<rp> 标记是用在Ruby annotations 告诉那些不支持 Ruby 元素的浏览器如何去显示 
<rt> 标记 定义对ruby

Explanation of annotations:

<ruby> 标记 定义 ruby annotations. 
<section> 标记 定义一个区域 
<source> 标记 定义媒体资源 
<time> 标记 定义一个日期/时间 
<video> 标记 定义一个视频

11. If you want to write a label multiple times at once, then In Webstorm (take article as an example):

article*10+Tab (10 article tags need to be entered at once)

##12. Anchor point

13. Ordered list (that is, there is a sorting of 1234) and unordered list

Unordered:


        
  • xx
  •     
  • eweet
  •     
  • eqt

Running results:

##Ordered:

<ol>    <li>有序</li>    <li>有序吗?</li>    <li>有序</li>
</ol>

Note: Do not nest other tags between
    and
  • , but
  • can be nested, such as:

    <ol>    <li>
    <a>空连接</a>有序</li>    <li><strong>有序吗?</strong></li>    <li>有序</li>
    </ol>

    ##Run result:

    ##14. Custom list:

    ##dl

    dt (equivalent to title)

    dd (equivalent to list item)

    
    
        
    dt里面的文本内容
        
    dt里面的文本内容
        
    dd里面的文本内容
        
    dt与dd内容做对比
        
    dd的内容对比
        
    dd测试对比

    运行结果:


    说明:一般情况下最好只用一个dt就好

    15.table标签

    跨行、跨列:rolspan  colspan

    
        
            
        
        
            
            
            
        
        
            
            
            
        
        
            
           
         
     
    表头
    嫦娥月亮雾霾
    北京口罩测试列
    前台防护口罩

    16.{}的用法,以span标签为例:

    span{this is span markup$)*3 +Tab

    输入以上内容后,会显示如下效果:

    <span>this is span markup1</span>
    <span>this is span markup2</span><span>this is span markup3</span>

    17.form表单的用法:

    
    
         用户名:
         性别:男 女    
         城市:                天气:    

    运行效果如下:

    注意:在使用单选按钮的时候,标签名称一致,才可以实现单选的效果。如果想要用户在点击“女”或者“男”的时候也能实现选中按钮的效果的话,则有如下代码:

    性别:<input>
    <label>男</label>   <label>    
    <input>女</label>

    (男和女采用了两种不同的实现方式)

    18.option的快速输入法:

    option{200$年}*10+Tab键

    当输入完Tab键后会有如下代码生成:

    <option>2001年</option><option>2002年</option>
    <option>2003年</option><option>2004年</option>
    <option>2005年</option><option>2006年</option>
    <option>2007年</option><option>2008年</option>
    <option>2009年</option><option>20010年</option>

    19.checkbox:单选框

    <!--checkbox标签:--><input>勾选表示同意

    运行效果:


    20.表单分组:

    <!--表单分组-->
              用户名:    
         密码:
         分组2     英文名:    
         英文姓:

    以上分别为添加legend标签和不添加legend标签,运行结果如下:


    21.H1-H6的快速写法:

    h$*6+Tab键

The above is the detailed content of Detailed explanation of HTML5 basic tags and SEO code examples. For more information, please follow other related articles on the PHP Chinese website!

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
H5 Code Examples: Practical Applications and TutorialsH5 Code Examples: Practical Applications and TutorialsApr 25, 2025 am 12:10 AM

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

The Connection Between H5 and HTML5: Similarities and DifferencesThe Connection Between H5 and HTML5: Similarities and DifferencesApr 24, 2025 am 12:01 AM

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.

The Building Blocks of H5 Code: Key Elements and Their PurposeThe Building Blocks of H5 Code: Key Elements and Their PurposeApr 23, 2025 am 12:09 AM

Key elements of HTML5 include,,,,,, etc., which are used to build modern web pages. 1. Define the head content, 2. Used to navigate the link, 3. Represent the content of independent articles, 4. Organize the page content, 5. Display the sidebar content, 6. Define the footer, these elements enhance the structure and functionality of the web page.

HTML5 and H5: Understanding the Common UsageHTML5 and H5: Understanding the Common UsageApr 22, 2025 am 12:01 AM

There is no difference between HTML5 and H5, which is the abbreviation of HTML5. 1.HTML5 is the fifth version of HTML, which enhances the multimedia and interactive functions of web pages. 2.H5 is often used to refer to HTML5-based mobile web pages or applications, and is suitable for various mobile devices.

HTML5: The Building Blocks of the Modern Web (H5)HTML5: The Building Blocks of the Modern Web (H5)Apr 21, 2025 am 12:05 AM

HTML5 is the latest version of the Hypertext Markup Language, standardized by W3C. HTML5 introduces new semantic tags, multimedia support and form enhancements, improving web structure, user experience and SEO effects. HTML5 introduces new semantic tags, such as, ,, etc., to make the web page structure clearer and the SEO effect better. HTML5 supports multimedia elements and no third-party plug-ins are required, improving user experience and loading speed. HTML5 enhances form functions and introduces new input types such as, etc., which improves user experience and form verification efficiency.

H5 Code: Writing Clean and Efficient HTML5H5 Code: Writing Clean and Efficient HTML5Apr 20, 2025 am 12:06 AM

How to write clean and efficient HTML5 code? The answer is to avoid common mistakes by semanticizing tags, structured code, performance optimization and avoiding common mistakes. 1. Use semantic tags such as, etc. to improve code readability and SEO effect. 2. Keep the code structured and readable, using appropriate indentation and comments. 3. Optimize performance by reducing unnecessary tags, using CDN and compressing code. 4. Avoid common mistakes, such as the tag not closed, and ensure the validity of the code.

H5: How It Enhances User Experience on the WebH5: How It Enhances User Experience on the WebApr 19, 2025 am 12:08 AM

H5 improves web user experience with multimedia support, offline storage and performance optimization. 1) Multimedia support: H5 and elements simplify development and improve user experience. 2) Offline storage: WebStorage and IndexedDB allow offline use to improve the experience. 3) Performance optimization: WebWorkers and elements optimize performance to reduce bandwidth consumption.

Deconstructing H5 Code: Tags, Elements, and AttributesDeconstructing H5 Code: Tags, Elements, and AttributesApr 18, 2025 am 12:06 AM

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.

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

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

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.