Forum Moderators: mack
Please help!
I ran my webpage through the Validate webpages website and this message has come up;
"No DOCTYPE Declaration Found!
A DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate a document.
One should place a DOCTYPE declaration as the very first thing in an HTML document. For example, for a typical XHTML 1.0 document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Title</title>
</head>
<body>
<!-- ... body of document ... -->
</body>
</html>
For XML documents, you may also wish to include an "XML Declaration" even before the DOCTYPE Declaration, but this is not well supported in older browsers. More information about this can be found in the XHTML 1.0 Recommendation.
The W3C QA Activity maintains a List of recommended Doctypes that you can choose from, and the WDG maintains a document on "Choosing a DOCTYPE". "
Eliz.
Just add what they said to the top of your html,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
A great tool to help you write validated code is the HTML Validator here,
[addons.mozilla.org...]
It's an extension for the Firefox browser [mozilla.com]. It will quickly and easily tell you which lines of your code are out of order. No person validating their pages should be without it.
When you put the Doc type as you quoted above it means the html page you are creating is now called XHTML. HTML evolves into a few versions since its creation more than a decade ago. There are 4 versions of HTMLs and different browser will interpret the HTML tags slightly differently.
There are many limitations to HTML. So w3.org came out with XHTML to extend the last version of HTML 4. One thing that you will notice is that XHTML is case sensitive while HTML is not. So, whenever you create a web page it is good to put the Doc type above i.e creating XHTML page instead of HTML so that the various browsers will know how to interpret your page correctly and if sometime in the future when there are further changes to XHTML, the browser will know how to display your page correctly without you updating your web page to the latest version of XHTML.
There is no need to panic. Nothing serious about the error message. So from now on, please develop your site in XHTML instead of old HTML.
So from now on, please develop your site in XHTML instead of old HTML
Mistra, please be sure to thoroughly research your information before presenting it to the people on this forum who are looking for advice.
HTML 4.01 is not "old HTML"... 4.01 and (X) are their own respective doctypes, with their own benefits and pitfalls... web designers can use whichever version they want (heck, they don't have to use a doctype at all if that's what they want), provided they understand why one would be better suited over the other in a given application.
Booington, feel free to disregard the information I have quoted from Mistra's post. There are plenty of resources on this forum about doctypes, and the error message you received when validating tells you all you need to know to do your own research anyway. Welcome to the WebmasterWorld forum and best of luck
Mistra, please be sure to thoroughly research your information before presenting it to the people on this forum who are looking for advice.
Sorry if my layman's term "old HTML" is considered to be misleading.
From the authority itself [w3.org...] :
What is HTML 4?HTML 4 [HTML4] is an SGML (Standard Generalized Markup Language) application conforming to International Standard ISO 8879, and is widely regarded as the standard publishing language of the World Wide Web.
SGML is a language for describing markup languages, particularly those used in electronic document exchange, document management, and document publishing. HTML is an example of a language defined in SGML.
SGML has been around since the middle 1980's and has remained quite stable. Much of this stability stems from the fact that the language is both feature-rich and flexible. This flexibility, however, comes at a price, and that price is a level of complexity that has inhibited its adoption in a diversity of environments, including the World Wide Web.
HTML, as originally conceived, was to be a language for the exchange of scientific and other technical documents, suitable for use by non-document specialists. HTML addressed the problem of SGML complexity by specifying a small set of structural and semantic tags suitable for authoring relatively simple documents. In addition to simplifying the document structure, HTML added support for hypertext. Multimedia capabilities were added later.
In a remarkably short space of time, HTML became wildly popular and rapidly outgrew its original purpose. Since HTML's inception, there has been rapid invention of new elements for use within HTML (as a standard) and for adapting HTML to vertical, highly specialized, markets. This plethora of new elements has led to interoperability problems for documents across different platforms.
1.3. Why the need for XHTML?The benefits of migrating to XHTML 1.0 are described above. Some of the benefits of migrating to XHTML in general are:
Document developers and user agent designers are constantly discovering new ways to express their ideas through new markup. In XML, it is relatively easy to introduce new elements or additional element attributes. The XHTML family is designed to accommodate these extensions through XHTML modules and techniques for developing new XHTML-conforming modules (described in the XHTML Modularization specification). These modules will permit the combination of existing and new feature sets when developing content and when designing new user agents.
Alternate ways of accessing the Internet are constantly being introduced. The XHTML family is designed with general user agent interoperability in mind. Through a new user agent and document profiling mechanism, servers, proxies, and user agents will be able to perform best effort content transformation. Ultimately, it will be possible to develop XHTML-conforming content that is usable by any XHTML-conforming user agent.
W3C's mission is "To lead the World Wide Web to its full potential by developing protocols and guidelines that ensure long-term growth for the Web."
XHTML documents are XML conforming. As such, they are readily viewed, edited, and validated with standard XML tools.
XHTML documents can be written to operate as well or better than they did before in existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming user agents.
XHTML documents can utilize applications (e.g. scripts and applets) that rely upon either the HTML Document Object Model or the XML Document Object Model [DOM].
As the XHTML family evolves, documents conforming to XHTML 1.0 will be more likely to interoperate within and among various XHTML environments.
The XHTML family is the next step in the evolution of the Internet. By migrating to XHTML today, content developers can enter the XML world with all of its attendant benefits, while still remaining confident in their content's backward and future compatibility.
Booington, feel free to disregard the recommendations from W3C. You can ignore it at your own peril.
It is okay to continue with "old HTML" if you are using notepad to create your web page and feeling lazy to type or memorize those Doc type by heart.
Converting a site from html to xhtml is no biggie, really. But converting from transitional (even validated transitional) to strict IS a big deal. For someone just starting out, I'd advise not even learning the deprecated mark-up that is allowed by the transitional doctypes.
Booington, feel free to disregard the recommendations from W3C. You can ignore it at your own peril.It is okay to continue with "old HTML" if you are using notepad to create your web page and feeling lazy to type or memorize those Doc type by heart.
Or if you're designing new pages for an already-established 4.01 site... or if you're creating HTML emails... or if you're simply a content updater for a site built in 4.01...
And i didn't tell the O.P. to disregard the W3C's recommendations- I told him to disregard your ignorant comment that advised him to code every single web document in XHTML from now on.
Thank you for the advice
I've inserted the said html text into the, well, html. The site looks fine and everything is cool, on my browser (I use Netscape)and it works well on IE too.
But it has thrown a little prob. I'm using Dreamweaver 4 and unfortunately now the actual page on Dreamweaver itself is now blank but for a small yellow "shield" shape thing!
How do I get it back to normal on dreamweaver as I may need to modify it?
You can change the setting of your Dreamweaver by going to Edit> Preference.
And i didn't tell the O.P. to disregard the W3C's recommendations- I told him to disregard your ignorant comment that advised him to code every single web document in XHTML from now on.
Why so hostile? The person was asking about Doctype. I am just trying to help. W3C has produced a guideline and recommended that XHTML be used. Even Dreamweaver's default setting (in my case MX 2004) comes with Doctype. If the person does not wish to follow W3C's recommendation or my recommendation that he or she should create XHTML compliant webpage then it is up to him or her whether he or she wishes to follow the recommendation or not. There is no need to be hostile. Sorry if in anyway I offended you.
At any rate, this debate is not helpful for someone "New To Web Development". We've had many lengthy threads on the topic in the HTML forum, and that's a better spot -- it gets complex and is easily confusing.
a recent xhtml/html thread [webmasterworld.com]
From the W3C: a list of recommended declarations that you can use in your Web documents [w3.org]
Even though I am a new member here and I have not subscribe to the paid membership yet it doesn't mean I am new to web development. I rest my case.