search
HomeWeb Front-endHTML TutorialHave you ever carefully understood the tag, how it is defined and how to use it_HTML/Xhtml_webpage production

Foreword:
Today I was asked, "Have you carefully understood the tag?" I was stunned for a moment, because I first saw the suggestion to use XHTML Transitional DTD on W3cschool, and then I was very confused. Obediently set Dreamweaver's HTML document type to XHTML 1.0 Transitional by default. It has been used as a matter of course ever since. It’s true that people become lazier as they grow older, and many things are subconsciously taken for granted. Since I have been asked, I went to look for information, summarized it, and took it as a note~~ The definition of

: The
statement is located in the document The frontmost position in , before the tag. This tag tells the browser which HTML or XHTML specification the document uses.
This tag can declare three DTD types, representing strict version, transitional version and framework-based HTML version respectively. (If the markup in the document does not follow the DTD specified by the doctype declaration, the document may not pass code verification and may not be displayed correctly in the browser.)

Usage of :
Parsing: In the above declaration, it is declared that the root element of the document is html, which is defined in the public identifier as "-//W3C//DTD XHTML 1.0 Strict// EN" is defined in the DTD. The browser will understand how to find a DTD that matches this public identifier. If it is not found, the browser will use the URL following the public identifier as the location to look for the DTD.
-: Indicates that the organization name is not registered. The Internet Engineering Task Force (IETF) and the World Wide Web Consortium (W3C) are not registered ISO organizations.
is the default, indicating that the organization name has been registered.
DTD: Specifies the public text class, that is, the type of object being referenced. Default is DTD.
HTML: Specify a public text description, a unique, descriptive name for the public text being referenced. A version number can be attached at the back. Default is HTML.
URL: Specifies the location of the referenced object.
Strict: Excludes all representative attributes and elements that W3C experts want to phase out.

Three HTML document types:
HTML 4.01 specifies three document types: Strict, Transitional and Frameset.
a) If you need clean markup without cluttering the presentation layer, use the HTML Strict DTD type:

b) Transitional DTD can contain presentation attributes and elements that the W3C expects to be moved into style sheets . If the user is using a browser that does not support Cascading Style Sheets (CSS) and you have to use the rendering features of HTML, use the Transitional DTD type:

c ) Frameset DTD is used with A framed document. The Frameset DTD is identical to the Transitional DTD, except that the frameset element replaces the body element:


Three XML document types:
XHTML 1.0 specifies three XML document types: Strict, Transitional, and Frameset.
a) If you need clean markup without presentation clutter, use the XHTML Strict DTD type:

b) Transitional DTD can contain presentation attributes and elements that the W3C expects to be moved into stylesheets . If the user is using a browser that does not support Cascading Style Sheets (CSS) and you have to use the rendering features of HTML, use the Transitional DTD type:

c ) Frameset DTD is used with A framed document. The Frameset DTD is equivalent to the Transitional DTD, except that the frameset element replaces the body element:


Select the correct doctype:
To get the correct doctype declaration, The key is to make the dtd correspond to the standard that the document follows.
For example, assuming that the document follows the xhtml 1.0 strict standard, the document's doctype declaration should reference the corresponding dtd.
On the other hand, if the doctype declaration specifies an xhtml dtd, but the document contains old-style html markup, it is inappropriate; similarly, if the doctype declaration specifies an html dtd, but the document contains xhtml The 1.0 strict tag is also inappropriate.
If no valid doctype declaration is specified, most browsers will use a built-in default dtd. In this case, the browser will use the built-in dtd to try to display the tag you specify (but this is what happens when the page is poorly written).
I looked at JD.com, Taobao, and Blog Park, and they all use this one (I have always used this one):

But I found that Baidu and Google use "", so I checked the information carefully and found that HTML5 also uses this directly, but because HTML 5 is not based on SGML, there is no need to modify the DTD Make
references, but require a doctype to regulate browser behavior (to make browsers behave the way they should).

It is recommended to use "" directly in the future. Using will turn on the standard compatibility mode of the browser. In the standard compatibility mode, it is not guaranteed to be compatible with other versions (before IE6, directly Ignore it), Internet Explorer remains compatible, the rendering behavior of documents may be different from future Internet Explorer, but please feel free to use it~~

Tips:
XHTML 1 is the XML version of HTML 4.01, which is a format that is not forward-compatible.
The doctype in HTML 4.01 requires a reference to the DTD because HTML 4.01 is based on SGML.
SGML specifies a standard format for embedding description tags in documents and specifies a standard method for describing the structure of a document. The HTML format currently used on the WEB is a SGML document that uses a fixed set of tags.
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
如何在Chrome和Edge的所有选项卡中搜索文本如何在Chrome和Edge的所有选项卡中搜索文本Feb 19, 2024 am 11:30 AM

本教程向您展示了如何在Windows的Chrome或Edge中找到所有打开的标签页上的特定文本或短语。有没有办法在Chrome中所有打开的标签页上进行文本搜索?是的,您可以使用Chrome中的免费外部Web扩展在所有打开的标签上执行文本搜索,无需手动切换标签。一些扩展如TabSearch和Ctrl-FPlus可以帮助您轻松实现这一功能。如何在GoogleChrome的所有选项卡中搜索文本?Ctrl-FPlus是一个免费的扩展,它方便用户在浏览器窗口的所有选项卡中搜索特定的单词、短语或文本。这个扩

抖音怎么带标签引流?平台什么标签最容易引流?抖音怎么带标签引流?平台什么标签最容易引流?Mar 22, 2024 am 10:28 AM

抖音作为一款备受欢迎的短视频社交平台,拥有着庞大的用户群体。对于抖音创作者来说,带标签引流是一种有效提升内容曝光度和吸引关注的方法。那么,抖音怎么带标签引流呢?本文将为您详细解答这个问题,并介绍相关技巧。一、抖音怎么带标签引流?发布视频时,要确保选择与内容相关的标签。这些标签应涵盖视频的主题和关键词,以便让用户通过标签更容易找到您的视频。利用流行标签是增加视频曝光的有效方法。研究当前热门标签和趋势,将其巧妙地融入视频描述和标签中。这些热门标签通常具有更高的曝光度,能够吸引更多观众的关注。3.标签

抖音标签后面的时钟是什么?怎么给抖音账号打标签呢?抖音标签后面的时钟是什么?怎么给抖音账号打标签呢?Mar 24, 2024 pm 03:46 PM

在浏览抖音作品时,我们经常能看到标签后面有一个时钟图标。那么,这个时钟到底是什么呢?本文将围绕“抖音标签后面的时钟是什么”展开讨论,希望为您的抖音使用提供一些有益的参考。一、抖音标签后面的时钟是什么?抖音会推出一些热门话题挑战,用户参与时会在标签后看到一个时钟图标,这代表作品正在参与话题挑战,并显示挑战的剩余时间。对于一些具有时效性的内容,如节假日、特殊活动等,抖音会在标签后面附上时钟图标,提醒用户该内容的有效期限。3.热门标签:当某个标签变得热门时,抖音会在标签后面添加时钟图标,表示这个标签正

钉钉app外部联系人标签怎么删除钉钉app外部联系人标签怎么删除Feb 24, 2024 am 08:20 AM

钉钉app外部联系人标签怎么删除?钉钉中是可以删除外部联系人标签的功能,但是多数小伙伴不知道钉钉外部联系人标签如何的删除,接下来就是小编为用户带来的钉钉app外部联系人标签删除方法图文教程,感兴趣的用户快来一起看看吧!钉钉app外部联系人标签怎么删除1、首先打开钉钉APP,主页面中点击如下图所示的【管理】功能;2、然后进入到企业管理的界面,找到其中的【外部联系人】;3、接着在外部联系人设置功能页,选择【标签管理】服务;4、之后在联系人标签主页面,选择你需要删除的标签组类型;5、最后点击标签组红色

html5标签head和header有什么区别html5标签head和header有什么区别Jan 17, 2022 am 11:10 AM

区别:1、head标签用于定义文档头部,它是所有头部元素的容器,而header标签用于定义文档的页眉(介绍信息);2、浏览器都支持head标签,而旧版本浏览器均不支持header标签,需要IE9+以上浏览器才支持header标签。

深入了解HTML中的video元素深入了解HTML中的video元素Feb 24, 2024 pm 08:18 PM

HTML中video视频标签详解HTML5中的video标签是一种用于在网页上播放视频的标签。它可以使用不同的格式来呈现视频,例如MP4、WebM、Ogg等等。在本篇文章中,我们将详细介绍video标签的使用方法,并提供具体的代码示例。基本结构下面是video标签的基本结构:

如何使用HTML和CSS实现一个具有固定导航菜单的布局如何使用HTML和CSS实现一个具有固定导航菜单的布局Oct 26, 2023 am 11:02 AM

如何使用HTML和CSS实现一个具有固定导航菜单的布局在现代网页设计中,固定导航菜单是常见的布局之一。它可以使导航菜单始终保持在页面顶部或侧边,使用户可以方便地浏览网页内容。本文将介绍如何使用HTML和CSS实现一个具有固定导航菜单的布局,并提供具体的代码示例。首先,需要创建一个HTML结构来呈现网页的内容和导航菜单。以下是一个简单的示例

如何使用 Vue 实现带标签的输入框?如何使用 Vue 实现带标签的输入框?Jun 25, 2023 am 11:54 AM

随着Web应用的发展,带标签的输入框越来越受欢迎。这种输入框可以让用户更方便地输入数据,同时也方便用户对已输入的数据进行管理和搜索。Vue是一款非常强大的JavaScript框架,它可以帮助我们快速地实现带标签的输入框。本文将介绍如何使用Vue实现带标签的输入框。第一步:创建Vue实例首先,我们需要在页面上创建Vue实例,代码如下:&l

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.