In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today Xiaobian to share with you how to distinguish html and html5 related knowledge points, detailed content, clear logic, I believe most people still know too much about this knowledge, so share this article for your reference, I hope you have something to gain after reading this article, let's learn about it together.
So let's start with the H5.
That's right, because it's official, and even if your documentation contains a lot of code that HTML5 no longer supports, it's HTML5. Everything starts with XML.
Relationship between HTML and XML
HTML is called Hypertext Markup Language, XML is called Extensible Markup Language, they are actually one family, they all come from a language called SGML (Standard Generalized Markup Language). The language uses tags with angle brackets to mark up content, and borrowed from them to propose HTML for presentation and xml for machines. Why introduce xml in an article about html? Because html and xml are borrowed from each other, HTML has a DTD that draws on xml, and this DTD is the key to determining the HTML version.
XHTML has the exact standards of XML and the expressiveness of HTML (essentially HTML, but with a stricter use of tags).
HTML DTD
DTD, Chinese interpreted as document type definition, used to define the type of tag in xml, and there are also such DTDs in early HTML, the following are some HTML DTDs, you can see that the DTD will carry the version type, through this version type you can know which generation HTML is currently used (but HTML5 is a special case, he directly used). It is easy to distinguish HTML from HTML5.
//Strict for XHTML 4.0//Transitional for XHTML 4.0//Strict for XHTML 1.0//Transitional for XHTML 1.0 Difference between HTML and H5
Distinguishing HTML from H5 on a DTD is an easy way, but some developers may not have written a DTD for various reasons (The browser will parse it according to the default way, for example, if the browser defaults to h6 parsing, even if the code is HTML4.0, it will also parse it according to HTML5), or simply use H5 to write the document declaration (HTML5 is based on the previous HTML to add some new elements, so it is compatible with most of the old elements). At this time, it cannot be seen from the DTD. There's actually a fundamental way. Just look at the label.
The purpose of a DTD is to define which tags can be used in this HTML document, and the following method does the same. Some tags are unique to H5 (e.g. video,cavas,article), while others are deprecated by H5 (e.g. applet, center). As long as these tags are found in the code, you can determine whether the code is HTML5.
There are two special cases, one is that there is no such special tag in the code at all, even if the tag used is both before and after the version, in this case you can think it is h6, you can also think it is html4 (or other version), but you can not say it is not h6 (because people also follow h6).
The other situation is that both tags appear in the code, which only indicates that the developer level needs to be improved or that the project needs maintenance.
The above is "how to distinguish html and html5" all the content of this article, thank you for reading! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone 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.
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.