homepage Welcome to WebmasterWorld Guest from 184.72.72.182
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Which Doctype Should I Choose?
stevelibby




msg:576101
 10:01 am on Dec 21, 2005 (gmt 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?

 

victor




msg:576102
 10:11 am on Dec 21, 2005 (gmt 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.

stevelibby




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

i have tried and its does match nothing?

encyclo




msg:576104
 11:34 am on Dec 21, 2005 (gmt 0)

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.

stevelibby




msg:576105
 12:05 pm on Dec 21, 2005 (gmt 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?

victor




msg:576106
 12:11 pm on Dec 21, 2005 (gmt 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.

stevelibby




msg:576107
 12:31 pm on Dec 21, 2005 (gmt 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?

Robin_reala




msg:576108
 12:49 pm on Dec 21, 2005 (gmt 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.

stevelibby




msg:576109
 12:58 pm on Dec 21, 2005 (gmt 0)

by changing the & to &amp; would this have an effect on affiliate links?
How do i get around the "=" issue?

Robin_reala




msg:576110
 1:33 pm on Dec 21, 2005 (gmt 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?

Farix




msg:576111
 1:46 pm on Dec 21, 2005 (gmt 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.

stevelibby




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

it a javascript pick up from affiliate company:
Type=JS&EditorialID
ans also
EditorialID=371
the "=" appears an an issue

stevelibby




msg:576113
 2:04 pm on Dec 21, 2005 (gmt 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 ()

encyclo




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

Just add some quote around the onchange value:

onchange="make1.submit()"

That should fix it. :)

stevelibby




msg:576115
 3:55 pm on Dec 21, 2005 (gmt 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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved