Markup validation for doctype

Markup validation for doctype
But recently I found that using this method will cause problems, see the code:

Copy code
The code is as follows:

<!DOCTYPE HTML>
<html>
<head>
<title>test page</title>
</head>
<body>
<p><div>a</div></p>
</body>
</html>

If this code is tested with w3c markup validation, it is found that it can pass the validation. Because html5 validation is still in the experimental stage, it does not detect any illegalities.

But if you use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">, you will find that it does not validate.

The reason is that the p tag is special and cannot contain the block tag. It seems that using some experimental features too early may also cause problems. To be on the safe side, it is recommended to use <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">.

<<:  Detailed explanation of four solutions for implementing in-line scrolling on mobile devices

>>:  CSS -webkit-box-orient: vertical property lost after compilation

Recommend

Detailed explanation of whereis example to find a specific program in Linux

Linux finds a specific program where is The where...

About MariaDB database in Linux

Table of contents About MariaDB database in Linux...

Implementing timed page refresh or redirect based on meta

Use meta to implement timed refresh or jump of th...

Detailed Example of Row-Level Locking in MySQL

Preface Locks are synchronization mechanisms used...

How to modify the root user password in mysql 8.0.16 winx64 and Linux

Please handle basic operations such as connecting...

mysql5.5.28 installation tutorial is super detailed!

mysql5.5.28 installation tutorial for your refere...

Provides helpful suggestions for improving website design

<br />Scientifically Design Your Website: 23...

Vue imitates ElementUI's form example code

Implementation requirements The form imitating El...

CSS horizontal progress bar and vertical progress bar implementation code

Sometimes it’s nice to see some nice scroll bar e...

A screenshot demo based on canvas in html

Written at the beginning I remember seeing a shar...

Detailed explanation of the implementation of MySQL auto-increment primary key

Table of contents 1. Where is the self-incremente...

HTML table_Powernode Java Academy

To draw a table in HTML, use the table tag tr me...