April 19, 200818 yr Can someone explain in more detail the 3 different DOCTYPEs: STRICT, TRANSITIONAL and FRAMESET. What would be best for my website - it is going to be a business website (selling involved). Example taken from w3schools: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> Do I have to modify any of this to fit my own website???
April 19, 200818 yr Hi lordmagik76, Strict - This is exactly what it says on the tin, the strictest doctype around. You will have to follow the specifications and guidelines to the tee, otherwise your code will fail to validate. All depreciated/presentational tags and attributes won't be allowed. The benefit to using this doctype is that your code will be uber clean and free of clutter. Transitional - This doctype is slightly more lenient and will allow you to use depreciated/presentational tags and attributes. This should only really be used if people don't have CSS support and you need to use style="", for example. Frameset - Use this if your website is going to use frames. It's similar to the transitional doctype in other respects.
April 19, 200818 yr There are 3 Doctypes you can use: 1) Strict: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> This is used when you follow the specification exactly how its defined to be. Your markup will be clean and tidy with no presentational features in it (this should be added using CSS). 2)Transitional: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> This is used when you want to use the presentational tags and attributes in HTML such as <font>. It is less stringent that the strict doctype. 3) Frameset: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> This is very similar to transitional except it allows you to incorporate iframe (inline frames) into your website. In answer to your question, depending on how you code will depend on which doctype is best suited to your website. There is no right or wrong doctype for "business" or "personal" sites etc. You shouldn't really have to modify any of the doctypes however, if you really want your code to validate and certain settings on the doctype you use aren't cutting it, you can modify it. However, this is incredibly rare. I hope that gives you a general idea. Ravi
April 19, 200818 yr Author Thanks. That answers my question. So far I have only done some reading and exercises on Html, XHtml and Css and decided to use XHtml as it is recommended for the future, but besides a general idea of how things work I have no experience whatsoever of how, what and where. I am set on doing it myself however. I guess now it's just down to practice and asking lots of questions.
Create an account or sign in to comment