Topic: Document Type Definition (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10929" title="Pages that link to Topic: Document Type Definition (Page 1 of 1)" rel="nofollow" >Topic: Document Type Definition <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-01-2003 08:01
quote:
All XHTML documents must have a DOCTYPE declaration. The html, head and body elements must be present, and the title must be present inside the head element



Actually what does DTD do? I also read that there were three types of DTD such as strict, transitional and Frameset.

Do I have to put one of them all the time? Is that really important to understand?

Hiroki Kozai

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-01-2003 08:19

The gist of it is, omitting the doctype tells the browser, "This is an old page, which was made before most people knew they should use DOCTYPEs. Treat it as you would old pages." Which means the browser won't do exactly what it should; it'll use older methods of displaying pages.

For more details, see http://www.alistapart.com/stories/doctype/

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-01-2003 08:46
quote:
Using an incomplete or outdated DOCTYPE?or no DOCTYPE at all?throws these same browsers into ?Quirks? mode, where the browser assumes you?ve written old-fashioned, invalid markup and code per the depressing industry norms of the late 1990s. http://www.alistapart.com/stories/doctype/



quote:
(Note: The Opera browser does not play by these rules; it always attempts to render pages in standards?compliant mode. Go, Opera! On the other hand, Opera does not yet offer solid support for the W3C DOM. But they?re working on it.)



This rule annoyed me a lot. What the hell is the point that let browser do so? Why the hell browser doesn't do job properly without it?



Hiroki Kozai

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 03-01-2003 16:41

There are many ways to write code.

Some people do it propely, mnay mnay people do not. This leaves the browser to have to try to interpret the intentions of the author.

There are also several specifications for HTML, each with their own variations on implementation.

If the browser *knows* that you are writing in a specific version, it doesn't have to try to intrepret, it can proccess the code as it was intended.

Better for everybody.



Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-01-2003 17:33

"This rule annoyed me a lot. What the hell is the point that let browser do so? Why the hell browser doesn't do job properly without it?"

Because, not too long ago, standards were pretty much inexistant. Browser makers *made* the standards, you could say. They introduced tons of "extras" to HTML, and it started to get out of hand. The W3C came along and both Microsoft and Netscape agreed to consider what they said to be "standard." So more recent browser versions support these standards, which - and this is the important part - means they treat the same HTML code *differently* than they did before.

The problem is that that breaks old pages. An old page, written to be displayed the way browsers displayed it in 1995, viewed on a browser today, would look different because browsers treat the code differently.

To avoid this, Todd Farhner (sp?) proposed that browsers use the presence of the DOCTYPE to switch into "standards mode." Since hardly any old pages were made with DOCTYPEs, they will still work in the newer browsers. However, now that designers are starting to learn the importance of DOCTYPEs, they're creating pages that make use of the newer standards. And in the process, old web pages aren't being broken.

An important thing to realize is that no one should have *ever* made a page without a DOCTYPE. There is no HTML standard that doesn't require one. If one writes a page without a DOCTYPE, there's no reason the browser should do *anything* with it - the browser has every right to simply say "your page isn't written in a standard language, so i'm not going to display it." The fact that browsers display it at all is just to be nice.

So, the long and short of it is, always use a correct DOCTYPE, and you don't have to worry about this older "quirks-mode" stuff from the 90's.

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-02-2003 21:55

Hi, DL, Hi, Slime! Thanks a lot. I am understanding it. But I still feel unconfortable about it.

First of all, let me clear. There used to be no standard to make website before. People made standard to orgamize this web world better. But new browser doesn't work well to show old HTML's. A clever man introduced DTD to solve this problem. Using DTD, people can make web site without any problem.

What I am wondering is that there are so many web site without DTD. It seems to be built HTML, not HTML. But still looks all right. I don't know what you mean that old web pages are being broken.

And also, does that new standard mean XHTML? You said that Microsoft and Netscape made new standard.

Lastly, does latest browser doesnot support HTML properly without DTD anymore? You said following:

quote:
An important thing to realize is that no one should have *ever* made a page without a DOCTYPE. There is no HTML standard that doesn't require one. If one writes a page without a DOCTYPE, there's no reason the browser should do *anything* with it - the browser has every right to simply say "your page isn't written in a standard language, so i'm not going to display it." The fact that browsers display it at all is just to be nice.



I think there are so many many web site without DTD, a? Newer browser does show hard work properly only when putting DTD on it. I will keep it in mind.

Thanks for sharing your time. I really glad to hear and learn from you. Further advices, I would be greatful.

Cheers.



Hiroki Kozai

Perfect Thunder
Paranoid (IV) Inmate

From: Milwaukee
Insane since: Oct 2001

posted posted 03-03-2003 06:25

If a browser sees a site without a DTD, it displays the site using rules from the old days.

If a browser sees a site with a DTD, it displays the site using modern rules. Different DTDs have different rules.

If you want to use modern web authoring techniques (such as CSS), it's best to use a DTD also. However, if you don't have one, the browser will do its best to display it anyway.

In general, old web pages that aren't made according to modern standards are considered "invalid" -- that is, they don't follow all the rules. They only work because browsers try hard to understand them. A "strict" parser, one that requires you to follow all the rules, will say that the old pages are written incorrectly.

Microsoft and Netscape didn't write the modern standards. They had a conflict, we call it the Browser Wars, where they each made their own version of HTML, with special things that only worked on one browser or the other. To help end the Browser Wars, the World Wide Web Consortium (W3C, or just W3) created what we call "web standards" which would work on all browsers. Microsoft and Netscape are members of the W3, but they're not the entire thing.

Web standards aren't perfect, and not all browsers support them in the same way, but things have improved greatly since 1997, or even 1999.

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 03-03-2003 08:17

PT, Thanks a lot. I am glad to hear from you. Have a good day. See ya.

Hiroki Kozai



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu