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 does html5 quality content usually include?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly introduces what html5 high-quality content usually includes, which is very detailed and has a certain reference value. Friends who are interested must finish reading it!

Html5 quality content usually includes: 1, title tag definition of the page title; 2, Favicon (site small icon); 3, encoding; 4, site description; 5, page keywords; 6, page author; 7, Viewport (mobile adaptation); 8, CSS stylesheet; 9, JavaScript script.

The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.

Depending on our requirements, a large amount of metadata can be defined in the HTML header, or there can be little or no definition at all. Although the header tag is part of the HTML document, the contents are not displayed in the browser.

Html5 quality content

1. Page title-tags

Tags are used to define the title of an HTML document, and only a document that contains tags is a valid HTML document. In addition, only one tag is allowed in an HTML document, and the tag must be placed in the tag.

Note that only plain text content is allowed inside the tag, not other HTML tags.

Example:

2 、 Favicon

The small icon to the left of the page title specifies its path. If not, the browser will look for it in the root directory.

3. Coding mode

The specification of the encoding method is put at the front of the head, if not specified, the browser will also determine according to the server's header, but it is not necessarily accurate.

Tags are used to provide metadata about HTML documents, such as page validity, page author, keyword list, page description, and so on. The data defined by the tag is not displayed on the page, but it is parsed by the browser.

The charset property is used to specify the character encoding of the HTML document. In the above example, we set the character encoding of the document to "UTF-8".

4. Website description

Defining the description information of the page is beneficial to the search of search engines.

5. Page keywords

Keywords are used to provide search engines with page-related information.

6. Page author

Author information can be extracted automatically through some content management systems.

7. Viewport (Mobile adaptation)

This is very common. Viewport usually adapts to the mobile side and places the page in a virtual window-viewport. If the web page does not use viewport, it will appear that we are very small when the mobile browser is opened, and we can also move and zoom. Low is amazing. Viewport is to let web developers dynamically set the size of the control elements in their web content through its size, so as to achieve the same effect on browsers as in web pages (scale reduction). To better support responsive websites

Width: controls the size of the viewport, which is generally specified as device-width (CSS pixels scaled by 100%), or you can specify a fixed value such as 600.

Height: specify the height corresponding to width.

Initial-scal: the initial scale, the scale of the page when it first load.

Maximum-scale: the maximum scale to which users are allowed to zoom.

Minimum-scale: the minimum scale to which users are allowed to zoom.

User-scalable: whether the user can zoom manually.

8. Embedded CSS style-label

Using tags, you can embed CSS styles in an HTML document, and it is important to note that the styles defined in the tags are valid only for the current HTML document. The sample code is as follows:

Write the title body {background-color: YellowGreen;} H2 {color: red;} p {color: green;} here

Note: tags can be used for unique styles in a document, but external style sheets are more appropriate for styles that are common in multiple documents.

9. External css style sheet-label

Tags are often used to reference external CSS stylesheets, and the tags contain two main attributes, rel and href. The rel attribute is used to indicate the type of reference file, and the href property is used to set the path to the external file. The sample code is as follows:

Write the title here

HTML tags can contain any number of tags.

10. JavaScript script

Embed JavaScript script code or link into script files through script tags

[xss_clean] (") these are all the contents of the article" what does html5 quality content usually include? "Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow 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