search
HomeWeb Front-endH5 TutorialNew and abandoned tags for h5

This time I will bring you the new tags and abandoned tags of h5. What are the precautions when using the new tags and abandoned tags of h5. The following is a practical case, let's take a look.

1.video tag

What is the video tag?
Function: Play video
a.The first format:

Attributes of the video tag
src: used to tell the video tag the video address to be played
autoplay: used to tell Whether the video tag needs to automatically play the video
controls: used to tell the video tag whether the control bar needs to be displayed
poster: used to tell the video tag whether the video is not played before the placeholder image is displayed
loop: generally used to do Advertising video, used to tell the video tag whether it needs to be played in a loop after the video is played.
preload: Preload the video, but you need to pay attention to the conflict between preload and autoplay. If the autoplay attribute is set, the preload attribute will be invalid.
muted :Mute
width/height: Exactly the same as img tag

//设置 自动播放 + 控制条<video></video>//控制条 + 占位图<video></video>//广告视频 : 自动播放 + 无限循环 + 静音 + 宽度<video></video>

b. The second format

2.1. Format:

<video>
    <source></source>
    <source></source>
</video>

2.2. The significance of the existence of the second format:
Since video data is very important, the five major browser manufacturers are unwilling to support other people’s video formats, so there is no video format that is supported by all browsers.
At this time, in order to solve this problem, W3C introduced the second format of video tag

The meaning of the second format of video tag is to solve the problem of browser adaptation

# The ##video element supports three video formats. We can assign all three formats

to the video tag through the source tag. Then when the browser plays the video in the future, it will choose one of the three to support. format to play

2.3. Note:

2.3.1 Although the second format currently through the video tag can specify a video format supported by all browsers, it does not want all browsers to There is also a prerequisite for all browsers to play videos through the video tag, that is, the browser must support the HTML5 tag, otherwise it will not be played.

2.3.2 In the past, some browsers did not support the HTML5 tag, so in order to allow Some browsers in the past were also able to play videos through the video tag, so in the future we can use a JS framework called html5media to achieve

//示例代码:
<video>
    <source></source>
    <source></source>
    <source></source>
</video>
2. audio tag

1.What is the audio tag?

Function: Play audio

2.Format:

<audio></audio>
<audio>    <source></source></audio>
3.Note:

The use of audio tags and video tags The usage is basically the same. Most of the attributes that can be used in video can be used in the audio tag, and the functions are the same
except that 3 attributes cannot be used, height/width/poster

//第一种格式<audio></audio>
//第二种格式<audio>    <source></source></audio>
3. Details and summary tags

What are details and summary tags?

Function: Use summary tag to describe summary information, use details tag to describe detailed information
Default In this case, it is a folded display. If you want to see the details, you must click

Format:

<details>
    <summary>概要信息</summary>
    详情信息</details>
Sample code

<details>
    <summary>郑伊健</summary>简介:郑伊健,1967年10月4日出生于中国香港,籍贯广东恩平,香港影视演员、流行男歌手。1988年参加新秀歌唱大赛加入无线电视,因拍摄“阳光柠檬茶”广告而入行,拜罗文为师。1991年...</details>
Summary details.gif

New and abandoned tags for h5

4. marquee tag

1. What is the marquee ([mɑr'ki]) tag?

Function: Marquee

2. Format:

Content


3. Attributes:

direction: Set the scroll direction left/right/up/down
scrollamount: Set the scrolling speed, the larger the value, the faster
loop: Set the number of scrolls, the default is -1, which is infinite scrolling
behavior: Set the scrolling type slide to stop scrolling to the boundary, alternate to scroll to the boundary Just bounce back to

4. Note:

marquee tag is not a tag recommended by W3C, and this tag cannot be queried in W3C official documents, but major browsers support this tag very well

Sample code:

<!--滚动方向--><marquee>随便写点内容</marquee><marquee direction="right">随便写点内容</marquee><marquee direction="up">随便写点内容</marquee><marquee direction="down">随便写点内容</marquee><hr><!--设置滚动速度--><marquee scrollamount="1">随便写点内容</marquee><marquee scrollamount="100">随便写点内容</marquee><hr><!--设置滚动次数--><marquee loop="1">随便写点内容</marquee><hr><!--设置滚动类型--><!--滚动到边停止--><marquee behavior="slide">随便写点内容</marquee><!--往返滚动--><marquee behavior="alternate">随便写点内容</marquee><!--滚动图片--><marquee>
    ![](images/NJ.jpg)</marquee>

marquee scrolling direction

New and abandoned tags for h5#5. Abandoned tags

1.为什么HTML中有一部分标签会被废弃?
因为当前的HTML中的标签只有一个作用, 就是用来添加语义
而早期的HTML标签中有一部分标签是没有语义的,
有一部分标签是用来修改样式的
所以这部分标签就被淘汰了

<strong>被废弃标签</strong>
<br> <hr> <font>
<b> <u> <i> <s>以上标签都是没有语义的,都是用来修改样式的
b(bold) 加粗文本, 没有任何语义的
u(underline) 给文本天津下划线, 没有任何语义的
i(italic) 将文本倾斜, 没有任何语义的
s(strikethourgh) 给文本添加删除线, 没有任何语义的

注意点:
以后在企业开发中, 不到万不得已一定不要使用这些被废弃掉的标签 如果一定要使用, 一般情况下都是用来作为CSS的钩子来使用

<strong>推出的新标签</strong>
strong == b
ins == u
em == i
del == s
strong语义: 定义重要性强调的文字
ins语义(inseted): 定义插入的文字
em语义(emphasized  音标:[&#39;ɛmfə,saɪz]): 定义强调的文字
del语义(deleted): 定义被删除的文字

相信看了本文案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

推荐阅读:

iOS webView怎样加载HTMLString

关于正则表达式的几个小练习

The above is the detailed content of New and abandoned tags for h5. 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
Understanding H5: The Meaning and SignificanceUnderstanding H5: The Meaning and SignificanceMay 11, 2025 am 12:19 AM

H5 is HTML5, the fifth version of HTML. HTML5 improves the expressiveness and interactivity of web pages, introduces new features such as semantic tags, multimedia support, offline storage and Canvas drawing, and promotes the development of Web technology.

H5: Accessibility and Web Standards ComplianceH5: Accessibility and Web Standards ComplianceMay 10, 2025 am 12:21 AM

Accessibility and compliance with network standards are essential to the website. 1) Accessibility ensures that all users have equal access to the website, 2) Network standards follow to improve accessibility and consistency of the website, 3) Accessibility requires the use of semantic HTML, keyboard navigation, color contrast and alternative text, 4) Following these principles is not only a moral and legal requirement, but also amplifying user base.

What is the H5 tag in HTML?What is the H5 tag in HTML?May 09, 2025 am 12:11 AM

The H5 tag in HTML is a fifth-level title that is used to tag smaller titles or sub-titles. 1) The H5 tag helps refine content hierarchy and improve readability and SEO. 2) Combined with CSS, you can customize the style to enhance the visual effect. 3) Use H5 tags reasonably to avoid abuse and ensure the logical content structure.

H5 Code: A Beginner's Guide to Web StructureH5 Code: A Beginner's Guide to Web StructureMay 08, 2025 am 12:15 AM

The methods of building a website in HTML5 include: 1. Use semantic tags to define the web page structure, such as, , etc.; 2. Embed multimedia content, use and tags; 3. Apply advanced functions such as form verification and local storage. Through these steps, you can create a modern web page with clear structure and rich features.

H5 Code Structure: Organizing Content for ReadabilityH5 Code Structure: Organizing Content for ReadabilityMay 07, 2025 am 12:06 AM

A reasonable H5 code structure allows the page to stand out among a lot of content. 1) Use semantic labels such as, etc. to organize content to make the structure clear. 2) Control the rendering effect of pages on different devices through CSS layout such as Flexbox or Grid. 3) Implement responsive design to ensure that the page adapts to different screen sizes.

H5 vs. Older HTML Versions: A ComparisonH5 vs. Older HTML Versions: A ComparisonMay 06, 2025 am 12:09 AM

The main differences between HTML5 (H5) and older versions of HTML include: 1) H5 introduces semantic tags, 2) supports multimedia content, and 3) provides offline storage functions. H5 enhances the functionality and expressiveness of web pages through new tags and APIs, such as and tags, improving user experience and SEO effects, but need to pay attention to compatibility issues.

H5 vs. HTML5: Clarifying the Terminology and RelationshipH5 vs. HTML5: Clarifying the Terminology and RelationshipMay 05, 2025 am 12:02 AM

The difference between H5 and HTML5 is: 1) HTML5 is a web page standard that defines structure and content; 2) H5 is a mobile web application based on HTML5, suitable for rapid development and marketing.

HTML5 Features: The Core of H5HTML5 Features: The Core of H5May 04, 2025 am 12:05 AM

The core features of HTML5 include semantic tags, multimedia support, form enhancement, offline storage and local storage. 1. Semantic tags such as, improve code readability and SEO effect. 2. Multimedia support simplifies the process of embedding media content through and tags. 3. Form Enhancement introduces new input types and verification properties, simplifying form development. 4. Offline storage and local storage improve web page performance and user experience through ApplicationCache and localStorage.

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 Article

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

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.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools