Welcome to WebmasterWorld Guest from 54.196.244.45

Forum Moderators: incrediBILL

Message Too Old, No Replies

Which Doctype Should I Choose?

     
10:01 am on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


i wonder if any here can help me, i need to declar a doc type in my web pages, currently i used html, asp in my pages, so what doctype should i place in my site?
10:11 am on Dec 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 4, 2002
posts:1314
votes: 0


It depends on what tags you've used in the HTML.

Different doctypes declare different sets of tags as valid; and (with quirks mode) prompt some browsers into rendering some tags in different ways.

Full list of recommended doctypes here:

[w3.org...]

I suggest you start with a low numbered transitional type. Validate some pages with that dotype to get an idea of how well your HTML matches it.

10:37 am on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


i have tried and its does match nothing?
11:34 am on Dec 21, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


If you have an existing site with no doctype, the first one to try would be this one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

If you add that and the page layout goes all wrong, then use this instead:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

Then use the HTML validator [validator.w3.org] and work your way through the validation errors - often by fixing one, others later on will be corrected too.

12:05 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


Thank you, i have just validated one of my sites using the first one you said.
But what does the doctype actually do to the performance of a web site and indeed how search engines pick it up?
12:11 pm on Dec 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 4, 2002
posts:1314
votes: 0


i have tried and its does match nothing?

Thing of HTML as a set of dialects. The doctype says which of the dialects you are using. If you are not using any of the standard dialect variations, then your choices are:

1. be happy with unvalidated HTML -- ie HTML that does not match any given dialect

2. modidy your HTML to match one of the existing dialects. Then you can use that one's doctype

3. write your own doctype. This really only works if you HTML is well-formed (if it is full of syntax errors then you'll never match any doctype). Writing a DTD to precisely describe how your HTML is structured offers the ultimate degree of control.

12:31 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


i seem to have these errors:

cannot generate system identifier for general entity "Category".
.co.uk&Category

It appears that the symbols & = appear to be the problem, how do i get around this?

12:49 pm on Dec 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


& is traditionally the start of an entity reference. For example, &pound; is rendered as . The spec says that if you want an & to appear in the page then you should use it's entity reference - &amp; . This applies to links as well.
12:58 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


by changing the & to &amp; would this have an effect on affiliate links?
How do i get around the "=" issue?
1:33 pm on Dec 21, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


There shouldn't be any problems, as the links will still work fine.

= shouldn't be an issue. What's the validator's exact error msg?

1:46 pm on Dec 21, 2005 (gmt 0)

Full Member

10+ Year Member

joined:July 30, 2003
posts:322
votes: 0


i need to declar a doc type in my web pages, currently i used html, asp in my pages, so what doctype should i place in my site?

ASP is irrelevant since it is a scripting language that writes part of the HTML. And since you already stated that you are using HTML, the following doctypes are appropriate:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

The first allows you to use tags and attributes that have been declared deprecated (i.e. font, s, strike, u, basefont, center, applet and etc.). The second doctype does not. Even if you stick with the transitional doctype, it is generally best that you avoid the depreciated tags and attributes as much as possible.

The full doctype is recommended because it will force certain browsers, especially IE6, into standards mode. This mode corrects some of the errors that IE6 has when it comes to rendering CSS.

Using &amp; instead of & in your links will not affect the links themselves.

1:49 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


it a javascript pick up from affiliate company:
Type=JS&EditorialID
ans also
EditorialID=371
the "=" appears an an issue
2:04 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


i have sorted most issues out now, but how can i get round this one:
Below are the results of attempting to parse this document with an SGML parser.

Error Line 172 column 47: an attribute value must be a literal unless it contains only name characters.
...ect name="Make" onchange=make1.submit() size="1" style="width: 135; font-fami
its telling there is a problem with ()

2:52 pm on Dec 21, 2005 (gmt 0)

Senior Member from CA 

WebmasterWorld Senior Member encyclo is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Aug 31, 2003
posts:9063
votes: 2


Just add some quote around the onchange value:

onchange="make1.submit()"

That should fix it. :)

3:55 pm on Dec 21, 2005 (gmt 0)

Preferred Member from GB 

10+ Year Member

joined:Jan 26, 2004
posts:636
votes: 0


Thank you, i now have perfect pages.
Something that i noticed is that there were a couple illegal characters lying about the place, could that be a reason why google is not indexing my home page, but updating the rest?