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

Several methods of implementing carousel images in JS

Carousel The main idea is: In the large container...

Implementation steps of vue-element-admin to build a backend management system

Recently, when I was working on a conference heal...

How to customize Docker images using Dockerfile

Customizing images using Dockerfile Image customi...

Get the IP and host name of all hosts on Zabbix

zabbix Zabbix ([`zæbiks]) is an enterprise-level ...

W3C Tutorial (3): W3C HTML Activities

HTML is a hybrid language used for publishing on ...

Vue3.0 adaptive operation of computers with different resolutions

First we need to install some dependencies npm i ...

Detailed explanation of the solution to permission denied in Linux

Permission denied: The reason for this is: there ...

Ubuntu 16.04 mysql5.7.17 open remote port 3306

Enable remote access to MySQL By default, MySQL u...

HTML+CSS to achieve text folding special effects example

This article mainly introduces the example of rea...

Implementation steps for installing java environment in docker

This article is based on Linux centos8 to install...

How to start tomcat using jsvc (run as a normal user)

Introduction to jsvc In production, Tomcat should...

Detailed installation and configuration of hadoop2.7.2 under ubuntu15.10

There are many Hadoop installation tutorials on L...

MySQL Index Optimization Explained

In daily work, we sometimes run slow queries to r...