XHTML Beginner's Tutorial: Understanding XHTML DTD Knowledge

Source: Internet
Author: User
Tags first row
xhtml| Beginners | tutorials

XHTML defines three types of file type declarations.

The most common use is the XHTML transitional.

<! The doctype> is mandatory to use.

There are three main parts of an XHTML document:

    • DOCTYPE
    • Head
    • Body

The basic document structure is this:

<! DOCTYPE ... >

In XHTML documents, document type declarations are always in the first row.

An instance of XHTML

This is a simple (minimized) XHTML document:

<! DOCTYPE htmlpublic "-//w3c//dtd XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >< Html>

Document type declarations define the type of document:

<! DOCTYPE htmlpublic "-//w3c//dtd XHTML 1.0 strict//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >

The rest of the document is similar to HTML:


3 Types of document declarations

    • The DTD prescribes the syntax of a Web page that uses Universal Markup Language (SGML).
    • Common markup Language applications such as HTML use DTDs to specify the rules that apply to labels in a particular document, including a series of elements and declarations of entities.
    • In common Markup Language (SGML) document type declarations or DTDs, XHTML is described in detail.
    • The XHTML DTD uses precise language that can be read by the computer to describe the syntax and syntax of the legitimate XHTML markup.

There are three types of XHTML documents:

    • STRICT (Strict type)
    • Transitional (Transition type)
    • FRAMESET (frame type)

Three types of XML documents for XHTML 1.0

XHTML 1.0 provides three types of XML documents to correspond to the three DTDs mentioned above.

XHTML 1.0 Strict

<! DOCTYPE htmlpublic "-//w3c//dtd XHTML 1.0 strict//en" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-strict.dtd " >

Use in such situations: need clean tags, avoid performance confusion. Use in conjunction with cascading style sheets.

XHTML 1.0 Transitional

<! DOCTYPE htmlpublic "-//w3c//dtd XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd " >

Used in situations where you need to take advantage of the performance features of HTML, and when you need to write XHTML for browsers that do not support cascading style sheets.

XHTML 1.0 Frameset

<! DOCTYPE htmlpublic "-//w3c//dtd XHTML 1.0 frameset//en" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-frameset.dtd" >

Used in situations where you need to use an HTML framework to split a browser window into two or more frames.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.