How to pass W3C validation?

How to pass W3C validation?

In addition to setting regulations for various tags, W3C also provides a verification function that allows web page creators to check whether they are actually following W3C regulations.
Preface
In addition to setting various tag regulations, W3C also provides a verification function to allow web page creators to check whether they are in accordance with W3C regulations.
How to achieve W3C XHTML1.0 standard web pages <br />Currently, XHTML1.0 and HTML4.01 are the most commonly used. Since XHTML1.0 evolved from HTML4.01, it is almost a revised version of HTML4.01. From a strict perspective, XHTML1.0 is more stringent. Although the rules of XHTML1.0 and HTML4.01 are very similar, since XHTML1.0 is a revised version of the latter, the regulations of the former are of course stricter than HTML4.01.
More likely to make mistakes
1. All tags must be lowercase. Error: <HTML> <Title> <BODY> <FonT>
Correct: <html> <title> <body> <font>
2. All attributes in the tag must have a value and double or single quotes cannot be omitted. Error: <a href=index.htm>Link</a>
Correct: <a href="index.htm">Link</a>
If there is no attribute value, you must repeat the attribute as a value, such as:
Error: <frame noresize>
Correct: <frame noresize="noresize">
3. All labels must be in pairs. If not, add / at the end. Wrong: <li>Mickey<li>Minnie<li>Pluto Correct: <li>Mickey</li><li>Minnie</li><li>Pluto</li>
Error:<br>
Correct:<br />
4. The minimum tags a web page should contain
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Title</title>
</head>
<body>
content
</body>
</html>
Note: Chinese web pages are usually encoded in big5, so you need to add the following line between <head> and </head>:
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
5. If you want to display [<][>][&], you need to enter other values. For example, if you want to display < > on the web page, you need to fill in:
&lt; &gt;
If you want to display & in a web page, it will be an error: &
Correct: &amp;
6. The order of labels cannot be mixed up. Error: <b><p>Text</b></p>
Correct: <b><p>Text</p></b>
7. Comments cannot contain----
Error: <!--Mickey is just---too cute-->
Correct: <!--Mickey is so cute-->
8. The image label must contain annotation text. The annotation text is the text that appears when you move the mouse pointer over the image:
Error: <img src="mickey.jpg">
Correct: <img src="mickey.jpg" alt="This is a picture of Mickey" />
8. XHTML1.0 document header is added to the first line of a normal web page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Frame page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
verify
W3C provides web page or upload verification. If you enter the URL and fail, a red warning will appear and tell you where the error is. Then you can modify it slowly according to the error.
W3C standard validation web page: http://validator.w3.org/
Postscript <br />Speaking of this, have you tried to paste other people's URLs to verify it?
Because most web pages are made for IE users, they will almost never pass the W3C. As long as IE can display it normally, it will be fine. If you have tried to paste any page of my web page, it should pass the verification. Take the teacher's teaching web page as an example. Except for the homepage, most of them will not pass. The 39th line of the left page menu is not enclosed in double quotes:
Error: aux1 = insFld(foldersTree, gFld("<font color=blue>中文</font>输入"))
Correct: aux1 = insFld(foldersTree, gFld("<font color="blue">Chinese</font> input"))
Basic web design - 01 Understanding HTML image tags without annotations (the most common mistake No. 8)
Do you really need to comply with W3C regulations? Complying with W3C regulations will allow your web pages to look the same when viewed with any browser. For example, if someone is making a web page for IE, the design may be different from the original when browsing with Firefox. So, try to comply with W3C regulations!

<<:  JavaScript removes unnecessary properties of an object

>>:  idea combines docker to realize image packaging and one-click deployment

Recommend

Detailed explanation of the use of Teleport in Vue3

Table of contents Purpose of Teleport How Telepor...

Join operation in Mysql

Types of joins 1. Inner join: The fields in the t...

Problems with creating placeholders for HTML selection boxes

I'm using a placeholder in a text input and i...

Use Javascript to develop sliding-nav navigation plug-in with sliding bar effect

Table of contents 1. Introduction 2. Usage 3. Dev...

JS interview question: Can forEach jump out of the loop?

When I was asked this question, I was ignorant an...

Detailed explanation of Nginx status monitoring and log analysis

1. Nginx status monitoring Nginx provides a built...

Detailed explanation of the use of custom parameters in MySQL

MySQL variables include system variables and syst...

How to build a K8S cluster and install docker under Hyper-V

If you have installed the Win10 system and want t...

Several scenarios for using the Nginx Rewrite module

Application scenario 1: Domain name-based redirec...

CSS specification BEM CSS and OOCSS sample code detailed explanation

Preface During project development, due to differ...

Usage and description of HTML tag tbody

The tbody element should be used in conjunction wi...

Detailed installation and use of virtuoso database under Linux system

I've been researching some things about linke...

JavaScript - Using slots in Vue: slot

Table of contents Using slots in Vue: slot Scoped...