Using CSS layout to create web pages that comply with WEB standards has always been a topic discussed by jb51.net. Today we will talk about declaring a document type description (DTD). All files need to start with a Document Type Definition (DTD) to tell the browser what rules to follow when opening the page. When we use the web design tool Dreamweaver to create a new web document, you will see the DOCTYPE declaration in the first line of the new document. DOCTYPE is the abbreviation of document type, which defines the basic type of the current document. That is, all files need to use a Document Type Definition (DTD). In fact, DOCTYPE is just a set of machine-readable specifications. Although it contains the URL of the file, the browser will not read these files. It is only used for identification and then decides what specifications to use to execute the code in the page. "The DOCTYPE goes before the opening html tag at the top of the page and tells the browser whether the page contains HTML, XHTML, or a mix of both, so that it can correctly interpret the markup." We use 4 document types to create our website <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> There are 4 document types: HTML4.01 provides two commonly used DTDs: (1) Strict: Requires strict DTD, and users must use tags that comply with the definitions in HTML4.01. (2) Loose lines: require a looser DTD, which is more compatible with other previous versions of HTML. XHTML1.0 provides two commonly used DTDs: (1) Transitional: A DTD with very loose requirements. It allows users to continue to use HTML4.01 tags, but must comply with XHTML writing. (2) Strict ![]() DTD stands for Document Type Definition. They define what can and cannot be in a specific version of XML, XHTML, and HTML. When loading a web page, the browser will use the established declaration specifications to check whether the content of the page is valid, and then take appropriate measures and code to interpret the code in the document. We don't need to delve into how they work, we just need to know that they can ensure that we develop standard web pages and ensure the correct rendering of CSS. In general, I recommend that readers choose a transitional document type. This type of DTD is more relaxed and easier to pass W3C code verification. It is more suitable for the current domestic development environment and the level of most developers. We also need to develop towards a strict level! However, the default setting in Adobe Dreamweaver CS3/CS4 tools is strict. |
>>: jQuery canvas draws picture verification code example
Table of contents Preface Core code File shows pa...
Table of contents 1. Background 2. What is silent...
How to define complex components (class component...
Table of contents 1. Use of arrow functions 1. Fr...
Last time we talked about some SQL query optimiza...
This article shares the specific code of Vue to r...
react-native installation process 1.npx react-nat...
Download MySQL for Mac: https://downloads.mysql.c...
<br />Most of the time when we talk about na...
Table of contents 1 Create configuration and data...
Preface Previously, I talked about the problem of...
The reason why Docker is so popular nowadays is m...
Alphabetical DTD: Indicates in which XHTML 1.0 DT...
This status code provides information about the s...
Table of contents 1. The difference between funct...