Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic features and syntax of HTML5

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, I would like to share with you the basic features and grammar of HTML5 what are the relevant knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you can get something after reading this article, let's take a look at it.

Overview of HTML5

HTML5 is the next major version of the HTML standard to replace HTML 4.01 Magi XHTML 1.0 and XHTML 1.1. HTML5 is also a standard for building and presenting content on the World wide Web.

HTML5 is the product of a collaboration between the World wide Web Consortium (W3C) and the Web Hypertext Technology working Group (WHATWG).

The new standard includes features such as video playback and drag and drop, which used to rely on third-party browser plug-ins such as Adobe Flash,Microsoft Silverlight and Google Gears.

Browser support

The latest versions of Apple Safari,Mozilla FireFox and Opera support most HTML5 features, and IE9 also supports some HTML5 features.

Mobile browsers pre-installed on iPhones,iPads and Android phones have good support for HTML5.

New features

HTML5 has introduced many new elements and attributes to help us build a modern website. Here are the main features introduced by HTML5:

New semantic elements: for example, and.

Form 2. 0: improved HTML Web forms to introduce some new attributes for tags.

Persistent local storage: in order not to be implemented through third-party plug-ins.

WebSocket: the next generation of two-way communication technology for Web applications.

Server push events: HTML5 introduces events from the Web server to the Web browser, also known as server push events (SSE).

Canvas: supports two-dimensional drawing programmatically with JavaScript.

Audio and video: embed audio or video in a web page without the need for third-party plug-ins.

Geolocation: users can choose to share their geographic location with our web pages.

Microdata: allows us to create custom vocabularies outside of HTML5 and extend web pages with custom semantics.

Drag and drop: drag and drop items on the same page from one location to another.

Backward compatibility

HTML5 is designed to be as backward compatible with existing browsers as possible. The new features are based on existing features and allow us to provide backup content for old browsers.

It is recommended that you use a small amount of JavaScript code to detect the support of a single HTML5 feature.

HTML5 syntax

HTML5 has "its own" HTML syntax, which is compatible with HTML 4 and XHTML1 documents that have been published on the web, but not the more complex SGML features in HTML 4.

HTML5 does not require lowercase signatures in XHTML, attributes must be in quotation marks, attributes must have a value, and syntax rules that must close all empty elements.

However, HTML5 is more flexible and supports the following forms:

The tag name is capitalized.

The double quotation marks of the attribute are optional.

Property values are optional.

Closing empty elements is optional.

DOCTYPE

In older versions of HTML, DOCTYPE was long because the HTML language was based on SGML and required a reference to a DTD.

HTML5 authors can use simple syntax to specify DOCTYPE in the following form:

XML/HTML Code copies content to the clipboard

The above syntax is not case-sensitive.

Character coding

HTML5 authors can specify character encodings using a simple syntax, as follows:

XML/HTML Code copies content to the clipboard

The above syntax is not case-sensitive.

Label

A common practice is to add a type attribute with a value of "text/javascript" to the script element, as follows:

XML/HTML Code copies content to the clipboard

HTML5 removes the additional information needed, and we can use a simple syntax like this:

XML/HTML Code copies content to the clipboard

Label

So far we have written as follows:

XML/HTML Code copies content to the clipboard

HTML5 removes the additional information needed, and we can use a simple syntax like this:

XML/HTML Code copies content to the clipboard

HTML5 element

The HTML5 element is marked with a start tag and an end tag. The tag is qualified by the tag name between the angle brackets.

The difference between the start tag and the end tag is that the latter signature is preceded by a slash.

Here is an example of a HTML5 element:

XML/HTML Code copies content to the clipboard

...

HTML5 tag names are case-insensitive and can be used in all uppercase or mixed cases, although the most common convention is to always use lowercase.

Most elements contain something, such as

...

Contains a paragraph. However, some elements cannot contain anything, and they are called blank elements. For example, br,hr,link and meta and so on.

HTML5 document

In order to get a better structure, the following tags are introduced:

Section: this tag represents a generic document or application section. It can be used with h2-h7 to represent the document structure.

Article: this tag represents a separate block of document content, such as a blog entry or newspaper article.

Aside: this tag represents a block of content that is slightly related to the rest of the page.

Header: this tag indicates the header of a section.

Footer: this tag represents the footnote of a section and can contain author, copyright, and other information.

Nav: this tag represents the section used to navigate the document.

Dialog: this tag can be used to mark the session.

Figure: this tag can be used to associate titles with some embedded content, such as charts and videos.

The tag of an HTML5 document looks like this:

XML/HTML Code copies content to the clipboard

...

...

...

...

...

...

These are all the contents of the article "what are the basic features and grammar of HTML5". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report