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

How to declare html5 document types

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

Share

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

This article mainly explains "how to declare the type of html5 document". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "how to declare html5 document types"!

Html5 requires a document type declaration. DOCTYPE document type declarations help to identify and display web pages correctly in browsers, and the lack of DOCTYPE document type declarations affects whether CSS styles take effect; therefore, DOCTYPE declarations are necessary for CSS stylesheets to take effect.

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

Declaration: is a document type declaration in the standard generic markup language that helps display web pages correctly in browsers. Because there are different types of files on the network, you need to declare the HTML version correctly so that the browser can correctly identify and display the content of your web page.

For the CSS stylesheet to take effect, the DOCTYPE declaration is required. Pages previously laid out by TABLE may be omitted or displayed normally by DOCTYPE. However, in the DIV CSS layout, although DOCTYPE is a piece of code, it is very important to affect whether the CSS style works or not. Some CSS styles are still valid without DOCTYPE html declarations, but some CSS styles are invalid. So DOCTYPE is essential.

Doctype declarations are case-insensitive and can be used in all of the following ways:

General statement:

HTML5

HTML 4.01

XHTML 1.0

Description:

The declaration must be placed on the first line of the HTML document

Pay special attention to the statement that it is not a HTML tag

Web page encoding settings

When garbled is displayed on the web page, add between the tags:

Note: commonly used codes are utf-8, gb2312, gbk, etc.

At this point, I believe that everyone on the "html5 document type declaration" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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