Table of Contents
Framework
" > 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:
Home Web Front-end HTML Tutorial Details about the tag in HTML

Details about the tag in HTML

Apr 07, 2017 am 09:43 AM
doctype html Label

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

The declaration is located at the very front in the document, before the tag. This tag tells the browser what kind of document to use. HTML or XHTML specification. This tag can declare three DTD types, representing strict version, transitional version and HTML version based on

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)

Usage

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Copy after login
Copy after login

Analysis: In the above statement, Declares that the root element of the document is html, which is defined in a DTD with a public identifier defined as "-//W3C//DTD XHTML 1.0 Strict//EN". Browsers will know how to find a match for this public identifier. DTD. If 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 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">
Copy after login

    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 login
  • Three
XML
    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 login
    Copy 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">
Copy after login
Copy after login

    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 login
    Copy 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!

Statement of this Website
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

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

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

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.

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

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

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

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

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

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

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

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

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

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

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

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

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

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

See all articles