In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what are the different specifications between html and xhtml", the content is simple and clear, and I hope it can help you solve your doubts. Let the editor lead you to study and learn what are the differences between html and xhtml.
The main difference between html and xhtml: (red will be used in the following examples)
1. XHTML elements must be nested correctly.
Example:
General html pages can be "main content" this is not strict, in XHTML is wrong; correct in the xhtml standard must require such "main content".
2. The XHTML element must be closed.
Exp:
1. An example in HEAD, "like this tag is feasible in html, but it must be turned off for the sake of xhtml standards."
2. If used in general html, "
"when this big line tag is changed, many people directly add it to the paragraph that needs to be wrapped."
"the tag is over, but it has to be like this in the XHTML CSS standard."
Paragraph text
"it means it has to be done by"
This wrapping label begins with the text in front of the article paragraph and follows the text with "
"the label ends.
3. For example, many people use the small line feed tag "br" when making html pages, but many people do not know that this tag needs to be wrapped in a closed style, for example, a lot of CSS production needs to be done after a paragraph of text, which adds a line break where it is needed. "
"just fine, but to tell you that this is also not standard, it will not pass in XHTML verification, and you must use" self-closing "to end it.
3. The label name must be in lowercase letters.
In previous web pages, many tags were usually arranged in uppercase or uppercase, but now tags are required to be lowercase uniform for the WEB standard.
Exp:
In the past, many "," and so on are used in uppercase or mixed case, such as "," or "," typesetting, but XHTML uniform requirements need to use "," lowercase.
4. The XHTML document must have a root element.
It means that when a tag begins, it ends with a tag, such as the beginning, which is used to close at the end of the content.
5. Add alt attribute to the picture.
In the past, you can add or not add the alt attribute to the img tag of the picture displayed in the web page, but now xhtml requires that you add the alt attribute, otherwise xhtml verification will indicate an error, even if the value of alt is empty.
Exp:
Error
Correct
What's the advantage of adding alt? Answer: plus alt can carry on the text description to the picture, can let the search engine distinguish the picture content, it is a good place to optimize the web page.
In fact, when we usually do DIV+CSS, pay more attention to the use of labels and specifications, we will soon grasp and do not have to pay special attention to xhtml standards.
These are all the contents of this article entitled "what are the differences between html and xhtml?" 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: 275
*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.