Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rating: Thread Rating: 6 votes, 3.50 average.
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-15-2003, 08:15 PM   PM User | #1
mattover-matter
Banned

 
Join Date: Mar 2003
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
mattover-matter is an unknown quantity at this point
Dtd

How do I know which doctype to use?
mattover-matter is offline  
Old 04-15-2003, 09:21 PM   PM User | #2
pardicity3
Regular Coder

 
Join Date: Jun 2002
Location: Iowa / Notre Dame
Posts: 538
Thanks: 0
Thanked 0 Times in 0 Posts
pardicity3 is an unknown quantity at this point
Depends exactly what you are coding in, HTML or XHTML. Once you know that then it is a process of choosing which type of doctype, transitional, strict, or frameset.

frameset- This one is obvious, if you are using frames, use this.

transitional- I am not sure if W3 meant this or not, but I usually think of transitional being used if you are transistioning between two languages (i.e. HTML and XHTML). It's less strict but still gets you going in the right direction.

strict- It's just that, strict. Everything has to be exactly according to w3 standards. This is the most standards compliant way of doing things and, as I see it, the only way coding should be done (unless of course you have frames).

Hope that helps. I know http://www.w3schools.com has some info on DTD's too if you need more explanation.

<edit>
I also found some good info by searching this forum for Document Type Declaration. Rememer, always search first!!
</edit>
__________________
My Site {Mike's Adventures}

Yikes, forums are almost too much fun.

Last edited by pardicity3; 05-26-2003 at 11:43 PM..
pardicity3 is offline  
Old 04-17-2003, 01:17 AM   PM User | #3
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
The XHTML transitinal DTD, is based on the HTML4.0 transitional DTD, this will support most depricated elements in order to compinsate for older browsers.

Of course the best way to be sure you are using your DTD correctly is to validate it using the W3C markup validator
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline  
Old 04-18-2003, 12:09 AM   PM User | #4
pardicity3
Regular Coder

 
Join Date: Jun 2002
Location: Iowa / Notre Dame
Posts: 538
Thanks: 0
Thanked 0 Times in 0 Posts
pardicity3 is an unknown quantity at this point
Well since I got scared and realised that a topic I posted in is now sticky, I decided to write a little more!

Actually, I just noticed that there are no links to the actual DTD's anywhere. Here is my rundown:

XHTML DTD's
HTML 4.0 DTD's
__________________
My Site {Mike's Adventures}

Yikes, forums are almost too much fun.
pardicity3 is offline  
Old 04-22-2003, 11:09 PM   PM User | #5
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
And lets not forget the DTD to the module based XHTML (1.1)
Modularization takes markup and turns it into 'subsets' or abstract modules
For example, core modules would be:
Structural elements, Text containers, Hyperlinking, List oriented elements.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

http://www.w3.org/TR/xhtml11

<edit>
And a few side notes:
the DTD will be placed ABOVE your html element <html>.
A DTD is NOT a regular element OR a comment tag,
it's important its not treated like either.
Also note, its important that DOCTYPE is in caps.
</edit>
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.

Last edited by cg9com; 05-24-2003 at 10:05 AM..
cg9com is offline  
Old 05-22-2003, 09:16 PM   PM User | #6
Java Nuts
New Coder

 
Join Date: May 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Java Nuts is an unknown quantity at this point
hey, (adding a question here ) does it matter if you use a DOC TYPE? I have some sites without a DOC TYPE tag. So do you have to have one or is it just..there? lol
and- whats the purpose in them?

thanks - you guys rock
Java Nuts is offline  
Old 05-22-2003, 09:19 PM   PM User | #7
Saj
Regular Coder

 
Join Date: Feb 2003
Posts: 181
Thanks: 0
Thanked 0 Times in 0 Posts
Saj is an unknown quantity at this point
Well, the browser will interpret the markup reardless of a Doctype. The Doctype is used to tell the browser what language is used, and where the base Document Type Declaration (W3's DTD file) is located. However, if you don't use valid code, then adding the Doctype is useless, as your browser uses its own DTD to translate the tags.
__________________
- Saj
Saj is offline  
Old 05-24-2003, 06:02 AM   PM User | #8
cg9com
Senior Coder

 
Join Date: Jul 2002
Posts: 1,628
Thanks: 0
Thanked 0 Times in 0 Posts
cg9com is an unknown quantity at this point
wait!

Quote:
Originally posted by Saj
The Doctype is used to tell the browser what language is used, and where the base Document Type Declaration (W3's DTD file) is located.
This information is called the Document Type Definition

Also, when adhering to a strict XHTML DTD, there are a few important rules, such as including an XML namespace, etc.

For more information on the XHTML DTD jargon, refer to this related thread in the XML catagory, as it covers that particular side of the DOCTYPE:
http://www.codingforums.com/showthre...threadid=17764
__________________

Moderator: General web building

Get out from under them, resist and multiply.
Get out from under precipice and see the sky.
cg9com is offline  
Old 05-26-2003, 10:43 PM   PM User | #9
giz
Regular Coder

 
Join Date: Apr 2003
Location: UK
Posts: 226
Thanks: 0
Thanked 0 Times in 0 Posts
giz is an unknown quantity at this point
Valid DOCTYPE list.

List of Valid DOCTYPE statements:

http://www.w3.org/QA/2002/04/valid-dtd-list.html


Up to date: published less than 2 months ago.
giz is offline  
Old 05-26-2003, 10:46 PM   PM User | #10
giz
Regular Coder

 
Join Date: Apr 2003
Location: UK
Posts: 226
Thanks: 0
Thanked 0 Times in 0 Posts
giz is an unknown quantity at this point
pardicity3: Your search ID in the search in your post above has expired.
giz is offline  
Old 08-08-2003, 12:38 AM   PM User | #11
skinme!
New Coder

 
Join Date: Jul 2002
Location: London, UK
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
skinme! is an unknown quantity at this point
Quote:
Originally posted by pardicity3
Actually, I just noticed that there are no links to the actual DTD's anywhere.
What do you mean? The actual .dtd files? Then the link's in the Document Type Definition

http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

http://www.w3.org/TR/html4/frameset.dtd
http://www.w3.org/TR/html4/strict.dtd
http://www.w3.org/TR/html4/loose.dtd

http://www.w3.org/TR/REC-html40/frameset.dtd
http://www.w3.org/TR/REC-html40/strict.dtd
http://www.w3.org/TR/REC-html40/loose.dtd
__________________
skinme.net / v2.php (design nearly completed)
skinme! is offline  
Old 11-06-2003, 02:52 AM   PM User | #12
cjwsb
Regular Coder

 
Join Date: Oct 2003
Location: The wild blue yonder
Posts: 283
Thanks: 0
Thanked 0 Times in 0 Posts
cjwsb is an unknown quantity at this point
Use strict...
__________________
My Site | My Blog
cjwsb is offline  
Old 11-06-2003, 03:07 PM   PM User | #13
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Quote:
Originally posted by cjwsb
Use strict...
There are multiple reasons for why you would prefer something other than strict...
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline  
Old 11-10-2003, 12:20 PM   PM User | #14
hurricane
New to the CF scene

 
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hurricane is an unknown quantity at this point
You may find this useful: http://www.alistapart.com/articles/doctype/
hurricane is offline  
Old 12-18-2003, 02:44 AM   PM User | #15
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
An old thing I compiled some time ago as a response to a question on XHTML-L, that might be useful to you when you want to know whether XHTML1.0 Strict or Transitional is the DOCTYPE for you:
<http://liorean.web-graphics.com/xhtm...se-strict.html>

Another a bit more compact resource on the same thing can be found at:
<http://www.zvon.org/xxl/xhtmlReferen...omparison.html>

And finally a shorter table that only takes elements and other markup commands into consideration, but doesn't go into depth about attributes:
<http://www.w3schools.com/xhtml/xhtml_reference.asp>
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:55 PM.


Advertisement
Log in to turn off these ads.