Original content on this site, please indicate the source when reprinting .
Preface:
Now we all pay attention to standard website building, and the technology used for standard website building is mainly XHTML CSS. Now we generally use HTML code, so how should I convert it? And what is the difference between HTML and XHTML? In this tutorial, you will learn the difference between HTML and XHTML and how to convert HTML to XHTML. After all, XHTML is the direction of development, so I think this tutorial is necessary to be published on this site. I feel that if you want to use standards, it is better to learn HTML first, because it is relatively simple, and then look at the tutorial.
XHTML introduction:
XHTML is the English abbreviation of EXtensible HyperText Markup Language, while HTML is HyperText Markup Language, which is the difference in name. In fact, the standard we are talking about should be XML, so why should we learn XHTML? Because the current HTML code is cumbersome and full of dangers, but the XML usage environment is not yet mature, an excessive product has been launched, which is XHTML, which plays a role in presenting the top and bottom. Some people also think that XHTML is an upgraded version of HTML, which is actually correct. My understanding is that XHTML makes HTML a more standardized markup language, making HTML powerful and reducing the cumbersome code, especially tables.
XHTML was designated as a standard by the international standards organization W3C (World Wide web Consortium) on January 26, 2000. It is considered to be the latest version of HTML and will gradually replace HTML. All browsers now support XHTML, which is compatible with HTML 4.0. Some people also think that XHTML is HTML4.01. If you write a website that meets the standards by yourself during the learning process, you can pass W3C verification. After the verification is passed, you will get a flag, usually XHTML1.0 authentication and CSS verification. I don’t know how many websites in China have passed these two verifications at the same time. You can go to http://www.w3.org/ to verify your site. If the two rules are met, we will add two codes to your webpage to show others that you have adopted the standard website building, awesome!
Why we use XHTML
XHTML is an overproduct of HTML upgrade to XML and is set as a standard. XHTML is fully compatible with HTML4.01 and has the syntax of XML. Let's take a look at an HTML containing the error code, as follows:
<html>
<head>
<title>This is bad HTML</title>
<body>
<h1>Bad HTML
</body>
Although it contains an error code, it can still be displayed normally when we browse in the browser. XML is a markup language, but it requires that any element that appears in a web page should be marked. XML is used to describe the data in a web page, while HTML is used to display elements in a web page. At present, various browser technologies we use on the Internet, including laptops, mobile phones, etc., require that some content browsing must be correctly marked. If there is an incorrect mark, it may make the display extremely confusing and even fail to display normally.
So combined HTML and XML, and there are other techniques, we have obtained a language that is useful now and in the future - XHTML.
When we are standardized in the future, we will use the correct format tags for XHTML to enable all browsers to execute correctly, so it is necessary for us to start learning XHTML now.
Differences between XHTML and HTML:
XHTML is a new technology, and it should be necessary to be familiar with this technology before browsers and some other software support it. In order to better learn XHTML, we should be familiar with HTML4.0. We can download a reference manual to get familiar with it. It is easier for us to learn XHTML. In other words, when we use HTML to write code, we should try our best to write less error codes, such as: we should use lowercase characters to write HTML, and after each tag, we should add the end of the tag, such as: <p>Welcome to you</p> There must be an end, and we must maintain this rule.
2 pages in total Previous page 12 Next page