Forum Moderators: open

Message Too Old, No Replies

DTDs

should I be concerned??

         

Newnewbie

4:08 pm on Oct 23, 2001 (gmt 0)

10+ Year Member



What does this code do?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Should I be concerned about it?

agerhart

4:14 pm on Oct 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I remember correctly this is for CSS

tedster

5:30 pm on Oct 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, CSS features are dependent on it -- as well as the HTML feature set. It's the Document Type Declaration (DTD) and it tells the visitor's browser which version of the language your code complies with.

Lots of threads around the forum about this, and some key things to pay attention to if you want to change it. A mismatch to your actual code can stop the newer browsers from rendering properly.

Try the Site Search for "DTD" for more details.

toolman

8:01 pm on Oct 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is good practice to include this in every page you build now....or do it later. Something to do with xml in the future will require this on every document according to the little old lady from the w3c I heard speaking at a lecture.

IanKelley

8:07 pm on Oct 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



tool's right... DTD's are required in XHTML.

They tell the renderer which language the page is written in.

I'm going to go out on a limb and say that 4.0 or 4.1 Transitional is exactly the DTD you want to be using right now. It will give you all the latest additions to HTML while still allowing pages with outdated code to display properly.

Xoc

8:48 pm on Oct 23, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The DTD mentioned there is telling a validator exactly what is and is not permitted in the HTML that you are using. You can find the actual DTD at [url]view-source:http://www.w3.org/TR/html4/loose.dtd[/url]. The file describes what tags and attributes are allowed. You can then validate your page using a validator, such as the one at [htmlhelp.com ]. All web pages should have the DTD specified and be validated.

Personally, I think that all pages should be in XHTML now. See this thread for the arguments: [webmasterworld.com ]

keyplyr

5:14 am on Oct 24, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I respectfully disagree with DTD being needed for anything but using a HTML syntax validator. I think it's just more garbage that basic editors and page builder software creates.

I don't use them on pages, never have. And a browser doesn't care which HTML version your page is using, as long as it's supported. I do however, use a doc type META tag and also declare the language and char set.

D C

IanKelley

7:44 am on Oct 24, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your're absolutely right... In fact you can fix a lot of rendering problems by removing DTDs.

The part you're missing, though, is that XHTML requires them and some time in the future it's going to be the standard.

Also, using DTDs forces you to write perfect code which can't be bad thing. :-)

I personally write all new code to be XHTML compatible (very simple to do) but for old sites I don't use DTDs at all.

joshie76

8:21 am on Oct 24, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aren't DTDs being abandoned in favour of XSDs (in regard to XML)?

Xoc

1:56 pm on Oct 24, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You had better test your site in IE6. It does look at the DTD to decide which version of HTML you are using. It renders things different depending on that DTD.

While XML schemas might eventually replace DTDs, the spec for them was only just approved in May 2001. So there are virtually no tools or user agents that produce and/or use them. DTDs have been around from the 1970s, so there are many, many things that deal with them.

gmiller

9:14 pm on Oct 25, 2001 (gmt 0)

10+ Year Member



It's not just IE6... IE5/Mac and Mozilla deliberately misrender pages without DTDs as a temporary workaround for compatibility with the ancient browsers as well.