Results 1 to 8 of 8
January 14th, 2005, 02:00 AM #1
Please can someone explain how important is it to declare the DOCTYPE at the top of each html page?<DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>
January 20th, 2005, 10:05 PM #2
- Join Date
- January 17th, 2005
- Mount Pleasant, WI
Obviously any browser will adapt to an html page without the DOCTYPE declaration. However the "correct" way is to include it on the first line of every page.
So why do it? There is a theory that some search engines rank pages that validate properly slighter higher. Without the DOCTYPE declaration, your pages will never validate properly.
For more info on it, read http://www.w3.org/QA/2002/04/Web-Quality
January 20th, 2005, 11:28 PM #3
I have also run across some JS code that will not run unless the doctype is there. As strange as it is, the missing doctype prevented the JS from running.
January 21st, 2005, 07:52 AM #4
Yesterday in Michael Campbell's newsletter Internet Marketing Secrets Newsletter #68, he wrote the following...
NEWS, VIEWS AND CLUES
Up to 27% more pages in the search engines
Are you losing web pages in the search engines. Is your
positioning going down. Are newer sites coming up ahead of
you? Here's something that may surprise you as being the
Very quietly on December 15th 2004, W3.org the world wide
web's official "governing body" posted new architecture
guidelines. You can read the full paper at the w3.org web
site, but after spending the better part of a day "down the
rabbit hole" I can tell you what's in there.
The web is evolving. So is the technology. Old "legacy" html
code just doesn't cut it anymore and has been officially
Ever since the 4.01 Specification W3C recommendation in late
1999, web page authors were supposed to be putting a DTD,
document type declaration at the beginning of their html code.
According to W3, "HTML 4.01 specifies three DTDs (Strict,
Frameset, Transitional), so authors must include one of the
following document type declarations in their documents."
Notice the strong wording, "must include."
Few people did and it took a long time before html software
and wysiwyg editors began inserting the code. The W3
stressed, yo dudes... "The document type declaration is
mandatory at the beginning of each HTML document." Notice
they've gone from "must" to "mandatory."
In case you're wondering, the DTD is the first line of your
html document and should look similar to this:
!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
In addition to the DTD, we're supposed to add character
encoding. Which conforms to the "Universal Character Set
(UCS), defined in ISO 10646. This standard defines a
repertoire of thousands of characters used by communities
all over the world."
Commonly used character encodings on the Web include
ISO-8859-1, ISO-8859-5, SHIFT_JIS, EUC-JP and UTF-8. But
it doesn't matter which one you use as, "This specification
does not mandate which character encodings a user agent
However, "Conforming user agents must correctly map to ISO
10646 all characters in any character encodings that they
recognize (or they must behave as if they did)."
So in other words, you need a character encoding or Charset.
You can use any one you want 8859-1, UTF-8, whatever, so
long as it conforms and correctly maps to the IOS 10646
standard. (Both 8859-1 and UTF-8 do.)
Hmm, I thought I'd do a little investigating:
meta http-equiv="Content-Type" content="text/html;
meta http-equiv="content-type" content="text/html;
So what was I using on my web pages? Turns out that every
web page I created in since January 2004 follows the rules.
But before that, it starts to fall apart. I did not include
a valid Charset. And I didn't have a DTD in any article, web
page or newsletter I wrote prior to July 2002 when I switched
to Mozilla as my html editor.
Turns out, not only was I missing "mandatory" elements,
a lot of the html code generated by PageMill, FrontPage,
HomePage and other editors I'd used over the years was
literally trash. How do I know? I used the W3.org's own
( If you want to clean and upgrade your code, here's the
f r e e url to push button validate your pages:
Without the Charset in my html page, here are the results
I received when I first ran the Validator on my pages:
"It is necessary to have this (Charset) declaration before
the page can be declared to be valid. I was not able to
extract a character encoding labeling from any of the valid
sources for such information. Without encoding information
it is impossible to reliably validate the document. I'm
falling back to the "UTF-8" encoding and will attempt to
perform the validation, but this is likely to fail for all
Simply put... without a Charset the web page is declared
officially "invalid." Very spooky indeed.
If you're like me and have been writing articles,
newsletters and making web pages for several years, chances
are you've got a whole lot of "legacy" documents that are no
longer valid... but how would the search engines behave if I
did update and validate my html.
You guessed it! I decided to set up a little experiment. I
started adding the DTD and Charset to some of my old web
pages. Ones that have been around for couple of years.
Let's fire up the most W3.org compliant html editor Mozilla,
which you can download for f r e e at Mozilla.org. Here is the
code it inserts in every new html document. (Please note for
this example, to prevent my text from turning into an html
document, I took out the usual coding brackets <> and
replaced them with - dashes - .)
!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
meta content="text/html; charset=ISO-8859-1"
-title- spicy title goes here -/title-
Turns out that 78% of the pages I validated and updated got
respidered. Of those that got respidered, 27% of them stuck
in the index, and my position in the SERPs (search engine
results pages) went up an average of 5 - 8%. Woo Hoo!
Then while on the phone with my friend Leslie Rohde (who -
being a spider programmer - knows more about search engines
than just about anyone else) asked if we had a control set
where we just changed the content but didn't add the DTD
Without it, how would we know if the pages were getting
spidered because the modification date had changed as
opposed to adding the compliance codes. (Leslie reminded me
that spiders always check the modification date, no change
usually means the pages won't get respidered.)
Doh! Back to the drawing board... or at least I thought.
Wait a minute, the experiment failed due to the lack of a
control piece, but the data is very relevant.
Adding the DTD and Charset achieved several things...
1) It gave my pages the mandatory w3.org html code
2) By making a change, the modification date changed
3) Making the change = 78% more spidering activity
4) 27% more pages ended up in the index as a result
5) More pages in the index = increased saturation
6) More saturation focuses more PR and link pop
7) More PR and link pop increases position in SERPs
8) Better SERPs = better chance to be found
9) First to get found, first chance to make the sale
10) Sales have gone up as a result
So to know for sure, which changes affected the results,
I'd have to set up another experiment... this time with a
control piece. But I'm ecstatic about the results. Any time
I can go from 100 to 127 pages in the index, just by adding
a snippet of code, and move up five spots in the SERPs to
boot, I'm a happy camper.
All you need to do, is verify your code using the push
button validator at the w3.org web site. Who knows, by doing
so, you could end up with more pages spidered and indexed
and increase your overall search engine positioning.
this is sure give many of us many restless nites...
that's my2cents, 'cuz I'm a legend in my own mind....
January 21st, 2005, 02:45 PM #5
Ok - here is what is one my pages:
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1
Is that ok? Also, it is not at the top of the page but at the very bottom of the head. So, does it need to move to the top? And does it go in the "head tag" or above the "HTML" tag?
January 21st, 2005, 03:29 PM #6Originally Posted by Ebudae
You can also confirm it by "Validating" your page at the w3.org through their validator (see Joe's post). If it gives you warning that no charset detected and UTF8 is used instead to validate your page then it means there is something wrong. If doesnt give you any message then you are fine.<DT>[size=1][color=navy]"The best measure of a man's honesty isn't his income tax return.[/color][/size]<DT>[size=1][color=navy]It's the zero adjust on his bathroom scale." Arthur C. Clark[/color][/size]</DT>
January 21st, 2005, 04:21 PM #7
January 21st, 2005, 04:33 PM #8
- Join Date
- January 18th, 2005
By Doug247 in forum Midnight Cafe'Replies: 2Last Post: June 24th, 2009, 11:12 PM
By shilmy in forum Cusimano.com ScriptsReplies: 5Last Post: July 8th, 2007, 11:11 AM
By djblade311 in forum Cusimano.com ScriptsReplies: 1Last Post: August 9th, 2006, 07:15 PM
By jimbo717 in forum Cusimano.com ScriptsReplies: 2Last Post: October 31st, 2004, 06:24 PM