In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is the role of DOCTYPE", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the role of DOCTYPE" this article.
Interviewer: we are now writing the first line of HTML code is usually!, please introduce the role of DOCTYPE (basic questions)
The DOCTYPE tag is a document type declaration of a standard general markup language and must be declared on the first line of the document to tell the browser what document standard to use to parse the web page. Different rendering modes will affect the browser's parsing standards for CSS and JavaScript.
Interviewer: what are the parsing modes for browsers to parse documents? (expansion question)
At present, there are two main parsing modes for documents (Note: another "quasi-standard mode" is only available in IE8 browsers, which is no longer considered by mainstream browsers):
Quirks mode: this mode simulates the behavior of older browsers. If DOCTYPE is not declared, the browser parses the document in this mode by default.
Standard mode (standards mode): browsers use W3C standards to parse rendered pages.
Interviewer: how to quickly check the parsing mode of the page? (divergent questions)
The HTML document object has a compatMode property that records the parsing mode of the page:
If the document is in promiscuous mode, the value of this property is BackCompat
If the document is in Standard Mode or quasi-Standard Mode (almost standards mode), this property is CSS1Compat
Const mode = document.compatMode; / / the parsing mode of the page if (mode = "BackCompat") {/ / rendering mode is hybrid mode} above is all the content of this article "what is the purpose of DOCTYPE", thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.