Details about the tag in HTML
The tag is very simple, you may not care. But have you ever carefully understood the tag? W3cschool recommends using XHTML Transitional DTD, and many people obediently use Dreamweaver’s HTML document The default type is XHTML 1.0 Transitional. It has been used as a matter of course since then. People are really lazy as they grow up, and many things are subconsciously taken for granted. #The definition of
Framework
(If the markup in the document does not follow the DTD specified by the doctype declaration, this In addition to failing code verification, the document may not be displayed correctly in the browser)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
#- : Indicates that the organization name is not registered with 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 is registered. Specify the public text class, that is, the
object
type of the referenced - . The default is DTD. ##HTML: Specify the public text description, that is, the
- object
type referenced. A unique descriptive name for the referenced public text. Can be followed by a version number. Defaults to HTML URL: Specifies the location of the referenced object. Strict: Exclude all representative
attributes and elements that W3C experts want to phase out - ##Three HTML document types
- HTML 4.01. Three document types are specified: Strict, Transitional and Frameset ##If you need clean markup to avoid clutter in the presentation layer, use the HTML Strict DTD type:
- Transitional DTD can contain rendering 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 When rendering features of HTML, use the Transitional DTD type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd">
- Frameset DTD is used for documents with frames. The Frameset DTD is identical to the Transitional DTD, except that the frameset element replaces the body element:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" " http://www.w3.org/TR/html4/frameset.dtd">
Copy after loginThree
- Document Types
XHTML 1.0 regulations Three XML document types are provided: Strict, Transitional, and Frameset.
- If you need clean markup to avoid presentation clutter, use the XHTML Strict DTD type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Copy after loginCopy after login
A Transitional DTD can contain rendering 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:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- Frameset DTD is used for documents with frames. The Frameset DTD is identical to the Transitional DTD, except that the frameset element replaces the body element: DTD corresponds 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 The xhtml 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):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Copy after loginCopy after login但是发现百度跟谷歌用的是“”,就再仔细查了一下资料,发现HTML5也是直接用的这个,不过是因为 HTML 5 不基于 SGML,因此不需要对 DTD 进行引用,但是需要 doctype 来规范浏览器的行为(让浏览器按照它们应该的方式来运行)。
建议在以后都直接用“”,用的话就会开启浏览器的标准兼容模式,在标准兼容模式下,不能保证与其它版本(IE6之前的,直接忽略吧),的 Internet Explorer 保持兼容,文档的渲染行为也许与将来的 Internet Explorer 不同,但也请大家放心地使用吧~~
PS:XHTML 1就是HTML 4.01的XML化,是一种不向前兼容的格式。HTML 4.01 中的 doctype 需要对 DTD 进行引用,因为 HTML 4.01 基于 SGML。SGML规定了在文档中嵌入描述标记的标准格式,指定了描述文档结构的标准方法,目前在WEB上使用的HTML格式便是使用固定标签集的一种。
The above is the detailed content of Details about the tag in HTML. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.
