<DOCTYPE> does not matter!

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22454
  • Loc: Pittsburgh PA
  • Status: Offline

Post November 18th, 2008, 7:45 am

Surprised? So was I. Blog author Justin James, who is involved in the W3C's HTML 5 Working Group, discusses this and four other oddities you may not know about HTML in his blog article Five HTML oddities that you may not know

    1. <DOCTYPE> does not matter
    2. Browsers are much more compliant than you think
    3. Compliance does less than you think
    4. Validators cannot cover all of the bases
    5. The <q> tag
"The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post November 18th, 2008, 7:45 am

  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post November 18th, 2008, 8:47 am

Well that certainly was news to me. And I've never even knew <q> existed. But what benefit does the <q> tag impart that couldn't be accomplished with actual, well, quotes?
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1597
  • Loc: Minneapolis, MN
  • Status: Offline

Post November 18th, 2008, 8:58 am

Here's a little bit more background about why Doctype is still a very good idea. At least until a theoretically future proofed browser like IE8 makes them obsolete.

http://www.alistapart.com/articles/beyonddoctype

I think the difference is between no doctype declaration and using the various different ones (strict, transitional, etc)
//// Designer, Art Director, Developer & Teacher of Interactive, Motion and 3D \\\\
WhenImNotSleeping.com

Post November 18th, 2008, 9:15 am

Oh great. More crap to remember so I can sound like I have a clue. :roll:



:P
- dM
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11817
  • Loc: Clearwater, FL
  • Status: Offline

Post November 18th, 2008, 10:37 am

I challenge anyone to look through the Firefox source code to see if there's anything that reacts to a DOCTYPE. :D

spork wrote:
Well that certainly was news to me. And I've never even knew <q> existed. But what benefit does the <q> tag impart that couldn't be accomplished with actual, well, quotes?


The browser can use a quotation style with consideration to the visitors language.

I'm not a language expert, but there's bound to be someone out there that scratches their head when they see "this" wondering what the hell those little marks are.
Why yes, yes I am.
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post November 18th, 2008, 11:04 am

Doh, never even thought of that. French uses chevron-style quotes, for example.
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post November 18th, 2008, 12:52 pm

Don't know what that guy is on about regarding doctypes. It's presence or absence makes a huge difference in my experience.

I think he's mixing two or three separate issues there in that short section. He's partly right, but wrong overall. He's certainly giving the wrong impression.
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1597
  • Loc: Minneapolis, MN
  • Status: Offline

Post November 18th, 2008, 2:42 pm

Zwirko wrote:
Don't know what that guy is on about regarding doctypes. It's presence or absence makes a huge difference in my experience.


Right because the absence makes many browsers go into quirks mode. However, once a doctype is declared it makes little or no difference to the browser if you declare strict, transitional, etc.
//// Designer, Art Director, Developer & Teacher of Interactive, Motion and 3D \\\\
WhenImNotSleeping.com
  • StarBucks
  • Student
  • Student
  • No Avatar
  • Joined: Jul 29, 2008
  • Posts: 86
  • Status: Offline

Post November 19th, 2008, 4:40 pm

Great Info, i never noticed the <q> tag before, what's the use of it btw?
  • suzie
  • Guru
  • Guru
  • User avatar
  • Joined: Feb 07, 2004
  • Posts: 1084
  • Loc: England
  • Status: Offline

Post November 23rd, 2008, 1:21 pm

Quote:
Surprised? So was I. Blog author Justin James, who is involved in the W3C's HTML 5


Ah! this came up on a list not too long ago.

It maybe it does'nt matter to Justin and co but it sure matters to the validator.

Validator will not validate a page with no doc type. Come to think of it validator is strict on transitioanal and strict. Both entirely different doc types of course.

Quote:
A DOCTYPE Declaration is mandatory for most current markup languages and without one it is impossible to reliably validate a document.
One should place a DOCTYPE declaration as the very first thing in an HTML document. For example, for a typical XHTML 1.0 document:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>

<title>Title</title>
</head>

<body>
<!-- ... body of document ... -->
</body>

</html>

:mrgreen: :mrgreen:
"http://jungaling.com/selamatdatang/"
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1597
  • Loc: Minneapolis, MN
  • Status: Offline

Post November 24th, 2008, 9:49 am

suzie wrote:
It maybe it does'nt matter to Justin and co but it sure matters to the validator.
Right but the point is that it will make no difference what so ever in your browser if you use strict or transitional since the browsers don't really have a switch for that. Its required for validation, but the articles point is that even a valid page won't specifically force a browser to render a page the way you intended it to because the spec is so open.
//// Designer, Art Director, Developer & Teacher of Interactive, Motion and 3D \\\\
WhenImNotSleeping.com
  • jezzbb
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jul 20, 2008
  • Posts: 5
  • Status: Offline

Post December 1st, 2008, 8:12 pm

anyways, it doesn't hurt to place the doctype declaration on web pages.
  • Truce
  • Guru
  • Guru
  • No Avatar
  • Joined: Apr 25, 2004
  • Posts: 1478
  • Loc: Washington DC
  • Status: Offline

Post December 3rd, 2008, 9:34 am

If you're such a terrible developer that you only care that your code works today and forget tomorrow, well, then you probably don't use DOCTYPES anyways so there's no news here.

What's different about XHTML from HTML? The fact that it's not as sloppy since that does nothing but contribute to the number of ambiguous rendering situations. If we start throwing away DOCTYPES because current browsers can't manage to utilize them properly we're throwing away hope for a more predictable development experience and letting the browsers lead the way (the same thing that got us into the position we are in now with IE).
  • Zwirko
  • Guru
  • Guru
  • User avatar
  • Joined: May 29, 2005
  • Posts: 1397
  • Loc: 55° N, 3° W
  • Status: Offline

Post December 4th, 2008, 5:29 am

Transitional:
Image

Strict:
Image

The particular flavour of doctype used can indeed change the way a page is rendered - as the above images clearly demonstrate. Those images are of very simple unordered lists, with very little styling, appearing in a floated div. The differences in rendering are not subtle.
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1597
  • Loc: Minneapolis, MN
  • Status: Offline

Post December 4th, 2008, 8:37 am

Zwirko wrote:
The particular flavour of doctype used can indeed change the way a page is rendered - as the above images clearly demonstrate. Those images are of very simple unordered lists, with very little styling, appearing in a floated div. The differences in rendering are not subtle.


are you using HTML (strict/transitional) or xHTML (strict/transitional) I think browsers do follow the xHTML one but not the other...
//// Designer, Art Director, Developer & Teacher of Interactive, Motion and 3D \\\\
WhenImNotSleeping.com
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 4th, 2008, 8:37 am

Post Information

  • Total Posts in this topic: 19 posts
  • Users browsing this forum: No registered users and 64 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.