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

Docker installation rocketMQ tutorial (most detailed)

RocketMQ is a distributed, queue-based messaging ...

Detailed explanation of MySQL InnoDB secondary index sorting example

Sorting Problem I recently read "45 Lectures...

Detailed explanation of the murder caused by a / slash in Nginx proxy_pass

background An nginx server module needs to proxy ...

Summary of the use of special operators in MySql

Preface There are 4 types of operators in MySQL, ...

HTML Tutorial: Collection of commonly used HTML tags (4)

These introduced HTML tags do not necessarily ful...

CentOS 7 configuration Tomcat9+MySQL solution

Configure Tomcat First install Tomcat Installing ...

JavaScript to implement a simple shopping form

This article shares the specific code of JavaScri...

Solution to "No input file specified" in nginx+php

Today, the error "No input file specified&qu...

Introduction to using Unicode characters in web pages (&#,\u, etc.)

The earliest computers could only use ASCII chara...

How to use explain to query SQL execution plan in MySql

The explain command is the primary way to see how...

WeChat applet implements SMS login in action

Table of contents 1. Interface effect preview 2.u...

Kill a bunch of MySQL databases with just a shell script like this (recommended)

I was woken up by a phone call early in the morni...

CentOS 7.2 builds nginx web server to deploy uniapp project

Panther started as a rookie, and I am still a roo...