Continuing from the previous article, unify thoughts and follow standards . How to follow standards? In fact, there are many standards, including structural standards, performance standards and behavioral standards. When choosing a standard specification, give priority to the standards recommended by W3C.
For structural standard options, take a look at Wikipedia’s recommended HTML standards:
http://zh.wikipedia.org/wiki/HTML#HTML
There are many standards. It is recommended to choose the standard that suits your company and team. In fact, the core idea is to make the project uniformly follow one standard. Strict XHTML is like this.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml " xml:lang="en" lang="en">
<head>
<title>Virtual Library</title>
</head>
<body>
<p>Moved to <a href=" example.org .http://example.org/"> example.org</a>.</p>
</body>
</html>
The media type of XHTML is application/xhtml+xml, not text/html, which is recognized by most devices. Adding an xml header declaration will also cause IE6's quirks mode. Generally speaking, it is not a very universal standard. When using it, you need to discard some of the W3C instructions. The improved version should be to remove the xml declaration and the media type to be application/xhtml+xml. Don't cause unnecessary trouble to your team's development.
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
<html lang="en-US" xml:lang="en-US" xmlns=" http://www.w3.org/1999/xhtml ">
<head>
<title>Introduction to HTML</title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
</body>
</html>
I recommend choosing the transitional version of the XHTML1.0 standard. If you think XHTML is too fancy and not applicable, the strict version of HTML4.0 is also a good choice. HTML2.0 has been replaced by HTML5, and it seems that HTML4 still has more backward continuity.