In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what is the meaning of dtd in html". In daily operation, I believe that many people have doubts about the meaning of dtd in html. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the meaning of dtd in html?" Next, please follow the editor to study!
In html, DTD refers to "document type definition", is a set of syntax rules about tags, is the validation mechanism of html files, and is part of the composition of html files. DTD defines a legitimate XML document building module that uses a series of legal elements to define the structure of the document.
The operating environment of this tutorial: windows7 system, HTML5 version, Dell G3 computer.
Document type definition (DTD) is a set of grammatical rules about tags. It is part of the specification of the XML1.0 version, is the verification mechanism of html files, and is part of the composition of html files.
DTD defines a legitimate XML document building module. It uses a series of legal elements to define the structure of the document.
DTD can be declared in a row in an XML document or as an external reference.
Internal DOCTYPE declaration
If DTD is included in your XML source file, it should be wrapped in a DOCTYPE declaration with the following syntax:
XML document instance with DTD (please open it in IE5 and later, and choose to view the source code):
] > ToveJaniReminderDon't forget me this weekend
Open the XML file in your browser and select the View Source command.
The above DTD is explained as follows:
! DOCTYPE note (second line) defines that this document is a document of type note.
! ELEMENT note (third line) defines that the note element has four elements: "to, from, heading, body"
! ELEMENT to (fourth line) defines the to element as "# PCDATA" type
! ELEMENT from (line 5) defines the from element as "# PCDATA" type
! ELEMENT heading (line 6) defines the heading element as "# PCDATA" type
! ELEMENT body (line 7) defines the body element as "# PCDATA" type
External document declaration
If the DTD is outside the XML source file, it should be encapsulated in a DOCTYPE definition with the following syntax:
This XML document is the same as the XML document above, but has an external DTD: (click to open the file and select the "View Source Code" command. )
Tove Jani Reminder Don't forget me this weekend!
This is the "note.dtd" file that contains DTD:
Why use DTD?
With DTD, each of your XML files can carry a description of its own format.
With DTD, independent groups can consistently use a standard DTD to exchange data.
Your application can also use a standard DTD to validate data received from the outside.
You can also use DTD to validate your own data.
DTD has three document types: s (Strict), T (Transitional), and F (Frameset).
Strict: use this type if you need clean markup to avoid clutter in the presentation layer. Use with cascading style sheets (CSS)
The Transitional:DTD can contain rendering attributes and elements that W3C expects to move into the stylesheet. If your reader uses a browser that does not support cascading style sheets (CSS) so that you have to use the rendering feature of HTML
Frameset: DTD should be used for documents with frames. Except that the frameset element replaces the body element, Frameset DTD is equivalent to Transitional DTD
Html5 basically doesn't have the strict requirements of XHTML 1.0 Transitional, and simplifies a lot of things that can be used directly.
At this point, the study of "what is the meaning of dtd in html" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.