Page 1 of 2
What's a DOCTYPE?
Posted: Wed Mar 28, 2007 4:40 pm
by JellyFish
Why do I need a DOCTYPE or DTD? And most importantly what is it and what does it do?
Posted: Wed Mar 28, 2007 5:21 pm
by Luke
Posted: Wed Mar 28, 2007 5:27 pm
by RobertGonzalez
You ought to try screwing one of them up one of these days. It is amazing what happens.
Posted: Wed Mar 28, 2007 5:47 pm
by JellyFish
Thanks ninja.
Although I don't understand what effect they have. Is there any examples on what changes DOCTYPEs make?
Also, what's strict, transitional and frameset?
Posted: Wed Mar 28, 2007 5:57 pm
by RobertGonzalez
Brief rundown...
Strict - Held to the w3c standard for strict syntax and formatting
Transitional (or loose) - allows for backward compatibility with other, older DTD's
Frameset - Frames
Posted: Fri Mar 30, 2007 4:30 pm
by JellyFish
Could maybe someone gives some examples on what the benefit in having a DTD would be? Maybe that'll clear some confusion.
As of right now, I don't see the purpose for me having one. It doesn't appear to do anything.
Posted: Fri Mar 30, 2007 4:34 pm
by feyd
With one, you can get validation. Without one, if memory serves, you'll get an error.
Without a doctype some browsers will have problems (or will display your pages in quirks mode.)
The green check mark is your friend.
Posted: Fri Mar 30, 2007 4:43 pm
by JellyFish
I see.
What's quirks mode, examples?
And I think when you say "The green check mark is your friend" you mean validation?
EDIT: Also, what DOCTYPE should I use, you see I don't understand.
EDIT 2: More precisely, of which should I use: Strict, Transitional or Frameset?
Posted: Fri Mar 30, 2007 4:44 pm
by RobertGonzalez
JellyFish wrote:Could maybe someone gives some examples on what the benefit in having a DTD would be? Maybe that'll clear some confusion.
As of right now, I don't see the purpose for me having one. It doesn't appear to do anything.
http://www.w3.org/QA/Tips/Doctype
http://www.w3.org/QA/2002/04/valid-dtd-list.html
Posted: Fri Mar 30, 2007 5:37 pm
by JellyFish
Okay, which should I use: XHTML or HTML; Strict, Transitional or Frameset?
Posted: Fri Mar 30, 2007 5:41 pm
by RobertGonzalez
How structured do you want to have to code? I use XHTML 1.0 strict. But I hold myself to a very high standard. I would say that folks that like a little bit of flexibility would probably go with an HTML 4.01 Transitional.
Posted: Fri Mar 30, 2007 5:56 pm
by Luke
It's the most difficult to conform to the strict doctype. XHTML is something you will need to make your own decision about. There are plenty of articles about it. It's kind of a hot issue for some folks.
Posted: Fri Mar 30, 2007 6:06 pm
by JellyFish
I tried Strict and maybe it was to strict for me. I tried Transitional and it went fine. What's Frameset stand for? Is there somewhere that tells me what Strict, Transitional and Frameset all allow and don't allow? Then maybe I could Choose which is best for me.
BTW every since I got a DTD my page appears the same on all browsers! Except a submit button's width was ridiculously wide and had to set a fixed width to the darn thing. What's up with that?
Posted: Fri Mar 30, 2007 6:08 pm
by Luke
we've posted articles that answer all those questions. You can also study the DTDs themselves to see what they allow/don't allow
Posted: Fri Mar 30, 2007 6:09 pm
by RobertGonzalez
I would probably say google for your answers to what the doctypes allow. The w3c.org site is also a very good resource.