Text mode in IE! Introduction to the role of DOCTYPE

Text mode in IE! Introduction to the role of DOCTYPE
After solving the form auto-fill problem discussed in the previous article, a new problem arose: some styles of the page were not displayed correctly in IE. The corresponding styles exist when checked through IE developer tools. Compared with the local HTML page that can be displayed correctly, the styles are basically the same, except that some font styles are displayed as font-size styles in the developer tools. Everything else is the same, including the margin style that causes the style to be displayed incorrectly. Finally, I found through the developer tools that the text modes of the two pages were different. The text mode of the page that could be displayed correctly was the standard mode, while the page that displayed abnormally was the miscellaneous mode.

When checking the source code of the web page, it was found that the abnormal web page was decorated by sitemesh, and the decorated page did not define the text mode !DOCTYPE, which caused the browser to fail to parse the web page through the standard mode.

! Document type (abbreviated as !DOCTYPE in English, full name DOCumentTYPE in English), a !DOCTYPE is a document type declaration of a standard generalized markup language. Its purpose is to tell the standard generalized markup language parser what kind of document type definition (DTD) it should use to parse the document. It appears as the first line of the file and has the following form:
<!DOCTYPE html
PUBLIC "Quoted String">
A "reference string" is called a public identifier, which refers to the desired Document Type Definition (DTD) by a "well-known" name, usually from an associated standard. [1]
Availability:
Specifies whether a formal public identifier (FPI) is a publicly accessible object or a system resource.
The Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C) are not registered ISO organizations.

<<:  Detailed explanation of Socket (TCP) bind from Linux source code

>>:  Some indicators of excellent web front-end design

Recommend

HTML+CSS to achieve drop-down menu

1. Drop-down list example The code is as follows:...

Detailed explanation of the solution to docker-compose being too slow

There is only one solution, that is to change the...

Several scenarios for using the Nginx Rewrite module

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

How to deploy Confluence and jira-software in Docker

version: centos==7.2 jdk==1.8 confluence==6.15.4 ...

Use SQL statement to determine whether the record already exists before insert

Table of contents Determine whether a record alre...

Usage and principles of provide and inject in Vue3

Preface: When passing data between parent and chi...

Learn more about using regular expressions in JavaScript

Table of contents 1. What is a regular expression...

Problems and pitfalls of installing Mysql5.7.23 in Win10 environment

I read many tutorials, but found that I could nev...

Introduction to Jenkins and how to deploy Jenkins with Docker

1. Related concepts 1.1 Jenkins Concepts: Jenkins...

MySQL starts slow SQL and analyzes the causes

Step 1. Enable MySQL slow query Method 1: Modify ...

Why does using limit in MySQL affect performance?

First, let me explain the version of MySQL: mysql...

What you need to understand about MySQL locks

1. Introduction MySQL locks can be divided into g...

A Preliminary Study on JSBridge in Javascript

Table of contents The origin of JSBridge The bidi...

Node.js+express+socket realizes online real-time multi-person chat room

This article shares the specific code of Node.js+...