doctype

Technical Details

I was recently looking at the guidelines for the amber quill and gold wyrm awards, and there is link to a website where you can get your html validated, or checked, anyway, to make sure its valid. I have a doc type error, and I have no idea how to fix that. (I simply don't have one, a doc type). I was wondering if anyone around here could give me some advice? The help they had here http://validator.w3.org/ just confused me more.

---

http://rage-against-godhood.net
care to walk among the gods?

By Frug Wed, 08/30/2006 - 12:07am.

Actually getting a thorough validation from w3 is both a good goal and a waste of time. More people should try to follow standards, but the new standards that get set up don't always seem practical or even sane to me. They "depreciate" things all the time, and it's like... Okay... whatever.

I've never had any problems with any browser actually giving a hoot what doctype is declared at the start of a page. Whatever the default is (ie. "it's just a bloody web page" ) works.

I just stick (!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN") with traingle brackets, not curved ones, at the very start of every page, even before (html). This declares your website as following the standards for HTML 4.01, the latest version.

Doctype does seem to matter if you're doing some CSS coding in bash or perl or whatever, but that probably won't come up. If you don't know what that means, it doesn't matter.

- - - - - - - - Do not use dotted lines - - - - - - - - -

Advertise your online RPG - http://www.pbem2.com

Thar Shaddin - freeform fantasy PbP RP: http://tharshaddin.com

By xfacelessx Fri, 09/01/2006 - 12:24pm.

Okay, that makes me feel better, since it was telling me there were errors in having > to close off code, which is ridiculous, since I know that is what you use for HTML coding, and that my HTML is good.

What I don't know, is if my HTML is 4.01. Since I created the site using a mixture of Dreamweaver 4 and my own coding. I have done a little CSS coding, but not on this layout, although perl/bash makes no sense to me.

Either way, thanks for your help.

By bebe the amazin... Fri, 09/22/2006 - 8:31pm.

You need a doctype, if for no other reason than to let visitor's browsers know what they're looking at. The validator thing doesn't really have anything to do with doctypes and why you need them.

There's some good information on it here at A List Apart.

Transitional is better than strict, just in case you do have some deprecated code in there.

-b.

By Praetorian Fri, 09/22/2006 - 10:22pm.

Correction. Doctypes do change the way your page is displayed. If you're using a correct doc type, it's more likely to show visual errors based on your code. You only really need a doc type if you're trying to have valid xhtml code.

IE.. everything properly nested, no errors, image tags closed with /, meta tags closed with /, everything lower case, br tags closed with / and so on.

And the correct doctype for transitional is..

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

It doesn't work unless you use the url. Mind you that's for xhtml. If you're only using html then you don't need a doctype anyway.

By Praetorian Mon, 09/25/2006 - 11:16pm.

As a follow up..

Here's a good article explaining Doctypes, with links to other relevent topics.

http://www.w3.org/QA/Tips/Doctype

By Alayla Fri, 10/20/2006 - 12:48pm.

Doctype declaration makes sure your pages behave predictably and is important for forward compatibility - when you don't have it, browsers revert to quirks mode, and well, it's called quirks mode for a reason. It definitely is worth adding that one extra line, as it can save you some headache in the long run.

On the site I maintain, we went without doctype for quite a long time, as I had trouble figuring out how to use it in the xsl template that generates our layout. I've been a much happier webmaster since I added it. If I fix a bug now, I can be reasonably sure it's fixed.

As somebody mentioned already, it is also important for screen readers and other alternate ways of displaying or accessing your site.

And finally, coding your site to standards is good for one more reason. As an individual webmaster, you get no say in what future browsers will or won't support. The guys at w3.org do.

--Alayla

God Wars II | MudLab

By Frug Sat, 10/21/2006 - 11:03am.

What if I want the browser to be working in quirks mode, and it defaults to quirks mode as you say? I want the default, because I know it works, so I leave it out. Actually I put the default in explicitly, but it doesn't matter. Future browsers will have to default to it too.

I maintain more backward compatibility now and I know it works in all the browsers. I suppose it might break if a new one came out, but I doubt it, and the changes would be minimal. In fact, the changes would be less than if I had to rewire everything now to ensure compliance with some theoretical future browser that doesn't exist, and may -still- display my changes funny, leading to yet more adjustments. Either way I'm sure I'm not saving any of my own time.

Indeed anything that would break on my site in a new browser would break on a million other sites, and 90% of people don't care why their new browser is displaying something funny, they will just switch back. I have heard too many people say "firefox sucks, it doesn't work on x website." Nevermind why. So the browser will -have- to work.

I don't like the people at wc3.org too much and as you say, it's my choice to support them or not. They're a body trying to impose standards in a place that has millions upon millions of entities who ignore their standards completely. Even worse is how they go about it, it's wishy washy, which makes me roll my eyes. It's wishy washy and some of it even pisses me off because I think it's stupid. "Don't use tables... unless... you want to use tables... for table things... But not for main layout!" Yeah piss off dude. Took me an hour to get div tags to do what I can do with tables in 5 minutes. "don't use center tag because... it's... bad style" Shut up, bad style, it fixes display issues in FIREFOX, the champion of standards.

- - - - - - - - Do not use dotted lines - - - - - - - - -

Advertise your online RPG - http://www.pbem2.com

Thar Shaddin - freeform fantasy PbP RP: http://www.tharshaddin.com

By Alayla Sat, 10/21/2006 - 11:44am.

Yep. I for one dislike the fact that the web police says "no" to opening any links in a new window. But as it happens, it's their way or the highway.

--Alayla

God Wars II | MudLab

By Frug Sat, 10/21/2006 - 10:49pm.

How is it their way or the highway? I ignore them and my pages display fine.

- - - - - - - - Do not use dotted lines - - - - - - - - -

Advertise your online RPG - http://www.pbem2.com

Thar Shaddin - freeform fantasy PbP RP: http://www.tharshaddin.com

By Cormac Doyle Mon, 10/23/2006 - 5:48am.

The "Web Police" do not say "No" to opening new windows ... they simply state that HTML/XHTML has no place in DICTATING such a choice ... it should be activity configured by the USer or the User's Browser.

It is actually VERY unfriendly to force pages to open in other windows if you are using any sort of assistive technology.
Also - a lot of "kiosk-mode" system will fail to work in such circumstances
Finally, recent browsers (both Firefox and IE) automatically suppress such "pop-up" windows ...

For these three reasons alone, it should be noted as a particularly bad idea to build "new window" pages into the design of your website ...

visit my website ... http://www.aecyr-grene.org/index.shtml ... and don't forget to vote for it Regular Smiley

By Praetorian Mon, 10/23/2006 - 8:29am.

Whether or not you agree with w3c isn't the issue. The fact is, if you ever want to design professional web pages, you'll follow at least some of what the w3c says. And frankly, if the doc type is making your page display incorrectly, that's usually a sign of sloppy and/or incorrect coding.

As for browsers, yes, Firefox does seem glitchy in certain aspects, but again, the fact is that FF, Netscape, and the other browsers which run along similar guidelines are alot better than IE, which is a monster when it comes to standards. Personally, I'd rather take the time to build a web page correctly to the best of my ability, and ensure that it appears correctly on all browsers.

That's my 2 cents.

By Frug Mon, 10/23/2006 - 11:46am.

Firefox allows links you click on to open in new windows directly without blocking. What it blocks is additional windows being triggered. I don't think it's -very- unfriendly to open an external link in a new window.

Key phrase praetorian, being "some of what the w3c says." I said if the code is clean, and displays correctly on (at least) the 3 major browsers, screw their finicky rules.

And actually I will bet money that numerous big business websites ignore them completely. Remember, your layout can't be dictated by tables... You have to use div tags because tables are the devil. Unless they're used for tabulating things or whatever. Your site layout is in tables, P. Go spend the next 2 to 4 hours recoding it. For nothing.

- - - - - - - - Do not use dotted lines - - - - - - - - -

Advertise your online RPG - http://www.pbem2.com

Thar Shaddin - freeform fantasy PbP RP: http://www.tharshaddin.com

By Alayla Mon, 10/23/2006 - 6:20pm.

Oh, I know the reasoning, and I had all links that opened a new window marked as such before. I also grudgingly fixed our site and removed them.

--Alayla

God Wars II | MudLab