Wednesday, 18 September 2013

DOCTYPE-The beginning of all xhtml documents.

The Document Type Definition DTD is used to define the set of markup declarations that define the kind of SGML family markup language you use in your website design.

The different DTD that can be used under different set of user requirements.


For XHTML version 1.0 we have 3 different DTD definitions.
  1. XHTML 1.0 Strict
     <DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
    
  2.  Transitional
     <!DOCTYPE html PUBLIC "-W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1-transitional.dtd">  
    
  3. Frameset
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1-frameset.dtd">  
    
For XHTML version 1.1 we have 2 different DTD definitions
  1. XHTML 1.1
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">  
    
  2. XHTML Basic 1.1
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">  
    
For XHTML version 2.0 we have
  1. XHTML 2.0
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml2.dtd">  
    
For HTML 4.01 we have 3 different DTDs similar to the XHTML 1.0
  1. Strict
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">  
    
  2.  Transitional
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">  
    
  3. Frameset
     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> 
Next comes the famous HTML5 
Though not a standard yet, but still has a small and simple DTD declaration to it


 <!DOCTYPE HTML>  
 

Yes,that is it.

Why all these different types of DTDs? 
What do they mean? (Strict/Transitional/Frameset/Basic/loose)

Watch the next post.
Post a Comment