Monday 20 May 2019

What are the Different XHTML Doctypes? tccicomputercoaching.com

There are three types of Document Type Definitions (DTDs). The easiest and most commonly used is the XHTML Transitional document.

A list of the XHTML Doctypes:
  • Strict
  • Transitional
  • Frameset
You should be very careful while writing XHTML document because the few XHTML elements and attributes, which are available in one DTD but not available in another DTD. So, you should select your XHTML elements or attribute carefully.




XHTML 1.0 Strict DTD

It is recommended to use when you want to use Cascading Style Sheet (CSS) strictly and avoiding to write most of the XHTML attributes.

Add the following DTD at the top of your XHTML document.

Syntax:

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

XHTML 1.0 Transitional DTD

It is recommended to use when you want to use many XHTML attributes as well as few Cascading Style Sheet (CSS) properties.

Add the following DTD at the top of your XHTML document.

Syntax:

1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

XHTML 1.0 Frameset DTD

It is recommended to use when you want to use HTML Frames to partition the browser window into two or more frames.

Add the following DTD at the top of your XHTML document.

Syntax:

1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

If it is a valid XHTML document, then No worry what DTD you are using to write your XHTML document.

Valid XHTML Document:

The XHTML 1.1 provides a definition of strictly conforming XHTML documents which MUST meet all the following criteria −
  • The document MUST conform to the constraints expressed in XHTML 1.1 Document Type Definition.
  • The root element of the document MUST be <html>.
  • The root element of the document MUST designate the XHTML namespace using the xmlns attribute.
  • The root element MAY also contain a schema location attribute as defined in the XML Schema.
There MUST be a DOCTYPE declaration in the document prior to the root element. If it is present, the public identifier included in the DOCTYPE declaration MUST refer the DTD found in XHTML 1.1 Document Type Definition.

If you like this post then like and share the post.

Call us @ 9825618292

Visit us @ http://tccicomputercoaching.com/

No comments:

Post a Comment