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
1. Install MySQL: Use the following three command...
This article example shares the specific code for...
Today, I found out while working on PHP that if w...
I won't say much nonsense, let's just loo...
Originally, this seventh chapter should be a deep ...
The following analysis is about product design pr...
Table of contents 1. Computed properties Syntax: ...
Table of contents Introduction: Installation of e...
MySQL 8.0 for Windows v8.0.11 official free versi...
This article example shares the specific code of ...
1. Favicon.cc To create ico icon websites online,...
In cells, light border colors can be defined indi...
Table of contents Method 1: set: It is not a data...
Preface This article mainly introduces the releva...
Table of contents 1. Commonjs exports and require...