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:
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.