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
How to use iframe: Copy code The code is as follo...
Problem Description In the login page of the proj...
CSS issues about background gradient and automati...
Deploy the MySQL environment locally (192.168.1.1...
Preface Recently, a problem occurred in the test ...
This article shares the specific code of JavaScri...
Table of contents 0x01. Install the Pagoda Panel ...
Table of contents Preface Browser compiled versio...
Table of contents Overview definition Instance Me...
1. Download Navicat for MySQL 15 https://www.navi...
Table of contents The order in which MySQL reads ...
The version of vsCode has been updated in recent ...
Copy code The code is as follows: <html> &l...
This article example shares the specific code of ...
Table of contents 1. Technology Selection 2. Tech...