Welcome! Log In Create A New Profile

Advanced

DTD - is it necessary?

Posted by fionam 
Announcements Last Post
Announcement : Programming Students at UNISA School of Computing 06/19/2019 02:01PM
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
avatar DTD - is it necessary?
October 25, 2011 08:11AM
Just curious. I've noticed on my travels through PHP examples on the web that some developers use the HTML/XHTML DTD in their pages that contain HTML and others don't. Is it strictly necessary?
avatar Re: DTD - is it necessary?
October 25, 2011 06:48PM
Quote
From the W3C Tips for Webmasters: Why specify a DOCTYPE? Because it defines which version of (X)HTML your document is actually using, and this is a critical piece of information needed by browsers or other tools processing the document. Since the document type is needed by web browsers, viewers and other HTML parsing tools in order to properly interpret a document as a particular version of HTML, the information provided by the <!DOCTYPE html> tag is especially significant in situations where there are no HTTP headers available or when the headers do not indicate an xHTML/XML media type such as application/xhtml+xml. Therefore, the DOCTYPE declaration is an important element in HTML documents, especially when creating polyglot HTML documents.

Ive never had problems not delaring it but you should yes
avatar Re: DTD - is it necessary?
October 26, 2011 01:33PM
Thanks, Peter, that's what I thought but doubts started entering my mind when I saw a number of examples that didn't use it ....
Sorry, only registered users may post in this forum.

Click here to login