Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the purpose of DOCTYPE web pages?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the role of DOCTYPE web page is what the relevant knowledge, content detailed and easy to understand, simple and fast operation, has a certain reference value, I believe that everyone will have a harvest after reading this DOCTYPE web page role is what article, let's take a look at it.

I. DOCTYPE NOTES

DOCTYPE is an essential part of building web pages that conform to the specification; unless your XHTML defines a correct DOCTYPE, neither your logo nor CSS will work, meaning that without this DOCTYPE declaration CSS will fail-CSS is useful, and without a declaration or declaration it will not display properly in standard readers.

DOCTYPE declaration

Start producing sites that meet standards, the first thing is to declare that they match the necessary DOCTYPE.

Looking at many XHTML-inspired websites, the first line reads:

Open some sites that meet standards, such as Macromedia, a well-known web management software developer, and you will find unusual code.

The code for other sites that fit the specification is as follows:

So what do these codes mean? Do we have to set it up?

What is DOCTYPE?

The following code is called DOCTYPE declaration. DOCTYPE is short for document type, which indicates what version of XHTML you are using.

The DTD in this example (for example, xhtml1-transitional.dtd in the above example) is called the document type definition, which asks for the specification of the document, and the reader annotates the logo of your page according to the DTD you define and displays it.

DOCTYPE names are an essential part of building standards-compliant web pages; unless your XHTML must include a rough DOCTYPE, neither your logo nor CSS will work.

XHTML 1.0 provides three DTDs for decision making:

* Transitional: requires a particularly loose DTD, which allows you to continue using HTML4.01 logos (but in accordance with xhtml). The incomplete code is as follows:

* Strict: Apply strict DTDs, you cannot use any presentation layer identifiers and attributes, such as

The full code is as follows:

* Frameset: By the way, the DTD used for the framework page scheme, if your page collection has a frame, you need to adopt this DTD, the incomplete code is as follows:

What DOCTYPE we decide

The ideal situation is certainly a severe DTD, but for most of us military web-scale planners, a transitional DTD(XHTML 1.0 Transitional) is the ideal choice at present. Because this DTD also allows us to use presentation layer identifiers, elements, and attributes, it is also easier to pass W3C code validation.

Note: The following "identification and attributes of the presentation layer" refer to tags that are purely used to control performance, such as tables used for typesetting, color labels, etc. In XHTML, tags are used to expose structure, not to implement presentation, and our transitional index is the ultimate implementation of data to interface with presentation.

For example, mannequins are easy to wear. Models are like data, clothes are forms, models and clothes are loose, so you can change clothes at will. In HTML4, data and presentation were mixed together, making it especially difficult to change presentation patterns at once. Oh, a little difficult to understand, this concept is important we gradually understand in the process of application.

fill

DOCTYPE declarations must be placed at the top of every XHTML document, above all code and logos.

DOCTYPE declaration can usually be determined in two simple ways. After Adobe Dreamweaver software, a new "CTRL+N" will pop up.

Click on the "Preferences" in the lower left corner to set the equipment configuration. The above is equal to DIV+CSSweb summary for DOCTYPE declaration and DOCTYPE sound and light.

Recommended DOCTYPE Statement (Common DOCTYPE Statement):

CSS5 recommends using the latest refined DOCTYPE name method:

In addition to content... .... II. HTML DOCTYPE

DOCTYPE is short for document type, which is used in Web RBI to indicate what version of HTML you can use.

DOCTYPE declarations are an essential part of creating an appropriate size XHTML page; unless your XHTML defines an exact DOCTYPE, neither your logo nor CSS will fail.

It's usually placed at the top of html page code

Summary, html DOCTYPE name is usually necessary, and the use of div+css is essential, if the lack or error document will cause your CSS failure or semi-failure, that is, because css failure, page layout things, some css attributes can not be reflected.

If you can't remember and accurately output DOCTYPE long string English, it's OK, CSS5 recommends that you use DW software to directly create html to get the complete structure of the most basic html details.

3. DOCTYPE html selection

Directly:

Make sure your CSS is secure.

The most primitive HTML source code:

CSS5 Content IV. Abbreviation of DOCTYPE

By now you can simply write your DOCTYPE,

HTML DOCTYPE top code:

It can be abbreviated as:

About "DOCTYPE web page what is the role of" the content of this article is introduced here, thank you for reading! I believe that everyone has a certain understanding of the knowledge of "DOCTYPE website is what". If you still want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report