Web page creation basic declaration document type description (DTD

Web page creation basic declaration document type description (DTD
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.

<<:  Solve the problem that some configuration files in /etc are reset after the docker container is restarted

>>:  jQuery canvas draws picture verification code example

Recommend

JavaScript to implement a simple clock

This article example shares the specific code for...

How to change the mysql password on the Xampp server (with pictures)

Today, I found out while working on PHP that if w...

harborRestart operation after modifying the configuration file

I won't say much nonsense, let's just loo...

Web Design Experience: Efficiently Writing Web Code

Originally, this seventh chapter should be a deep ...

Several principles for website product design reference

The following analysis is about product design pr...

A brief talk about calculated properties and property listening in Vue

Table of contents 1. Computed properties Syntax: ...

React uses emotion to write CSS code

Table of contents Introduction: Installation of e...

Introduction to new features of MySQL 8.0.11

MySQL 8.0 for Windows v8.0.11 official free versi...

Vue custom bullet box effect (confirmation box, prompt box)

This article example shares the specific code of ...

Collection of 12 practical web online tools

1. Favicon.cc To create ico icon websites online,...

JavaScript array deduplication solution

Table of contents Method 1: set: It is not a data...

Detailed explanation of how to view MySQL memory usage

Preface This article mainly introduces the releva...

Usage and difference of Js module packaging exports require import

Table of contents 1. Commonjs exports and require...