PDA

View Full Version : Which DOCTYPE do you use?


this_melancholy
8th April 06, 05:15 PM
So every one, which doctype do you use when you code websites?
I am a Strict-man myself. (n_n )

stealthyninja
8th April 06, 05:34 PM
It really depends on the project for me. It doesn't help that you develop a client's site with the Strict DOCTYPE and then if they make alterations to the copy and manually enter erroneous HTML (or unencoded ampersands, for instance) the site will no longer validate. Hence I generally tend to design and develop clients' sites in Strict, but change the DOCTYPE to Transitional before it goes live. Once again though, it depends largely on the project.

For personal sites I'll always use either HTML 4.01 Strict or XHTML 1.0 Strict since it teaches me coding discipline. You can't be lazy and leave a tag unclosed or nest tags improperly, et cetera.

Jen
8th April 06, 05:34 PM
I'm using Transitional.

What's two difference between transitional and strict? When I try strict and check the valid, I get many errors but for transitional I get less errors.

stealthyninja
8th April 06, 05:41 PM
Jen: Well, the best way to learn about it if you're interested would be firstly to read a good article (http://www.alistapart.com/stories/doctype/) discussing DOCTYPES and then to create a sample (X)HTML template. As you add content and elements and make changes to this sample document, pass it through the W3 validator (http://validator.w3.org/) so you'll learn where to look for errors creeping into your mark-up as well as how element nesting should be done, et cetera. The leap from Transitional to Strict really isn't that far, so don't be scared off at first.

mstwntd
8th April 06, 05:56 PM
HTML 4.01 Strict.

Ricky
8th April 06, 07:39 PM
HTML 4.01 Strict.

Why html strict? could'nt u try xhtml trad?

Anyway i start with trad if it validates at strict i change, just looks better does'nt it ;) yea im a cheater :D

mstwntd
8th April 06, 09:18 PM
Why html strict? could'nt u try xhtml trad?

Anyway i start with trad if it validates at strict i change, just looks better does'nt it ;) yea im a cheater :D

I'm not entirely sure what you mean by "trad" there. ;) XHTML, in any flavour, served as text/html is no better/faster/more-effecient than HTML 4.01, as all you're using under than content type is plain ol' text/html. In fact, when it comes to HTML vs. XHTML, the DOCTYPE, unlike the content type, does not play a major role. :)

stealthyninja
8th April 06, 10:22 PM
I'm not entirely sure what you mean by "trad" there.
I think he meant XHTML Transitional.

It's pretty much as mstwntd said; the HTML vs XHTML debate was a bit of a rage some time ago, with a lot of people arguing for and against how one should serve XHTML (text/html vs application/xhtml+xml, basically). I think you should just know the facts (http://www.w3.org/International/articles/serving-xhtml/) and the techniques (http://www.w3.org/2003/01/xhtml-mimetype/content-negotiation) before blindly deciding on a DOCTYPE or set method or way of doing things. I'm glad this came up, since the way you serve your document bears a relation to how your CSS will or won't be displayed from browser to browser.

Vox Pelli
15th April 06, 01:38 PM
I use Xhtml 1.0 Strict because as many others has said it teaches me how to do things right. It may be a smart move by stealthyninja to change it to transitional before publishing and it's certainly something I shall consider.

I haven't followed the debate considering content type and xhtml but it looks like somehting to consider and I should perhaps take a further look at it someday.

stealthyninja
15th April 06, 02:31 PM
With some PHP you can serve XHTML 1.1 (http://bitesizestandards.com/bites/proper-xhtml-handling-with-php) as application/xhtml+xml to browsers that support it and text/html to those that don't.

Justin G
17th April 06, 02:12 AM
I use strict of course. I have just gotten really use to it. I mean it also helps me develop good code, nothing left out. and shows most of my errors. Clients in my own experience like Strict better because they know its clean code.

Martijn
17th April 06, 11:59 AM
I use strict of course. I have just gotten really use to it. I mean it also helps me develop good code, nothing left out. and shows most of my errors. Clients in my own experience like Strict better because they know its clean code.

Exactly, it`s also better to learn how to code strict early on then doing is loose now and having to do it strict in a few years when u`ve gotten used to doing it loose ;)

.Mike
24th April 06, 12:42 AM
hmm i have never used strict well techinically i have but it ruined my entire site,

so now and days i use Transistional :)

joe
29th April 06, 08:25 PM
I always use strict. I don't see the point of Transitional, and never use it.

stealthyninja
4th May 06, 06:29 AM
joe: Well, one of the points of using a Transitional DOCTYPE from my perspective would probably be to ease old and brand-new developers alike into coding standards-compliant sites since Transitional DOCTYPEs are far more lenient. They're also useful when the leap to a Strict DOCTYPE is just too big or too costly (in time usually) for certain projects where one person or a small team of people are tasked with converting a huge site (3,000+ static HTML pages, for instance) over to web standards.

joe
4th May 06, 07:09 PM
I can understand why people starting off would use Transitional then work to Strict, but I don't think it's alright for professional coders to use Transitional, just like they shouldn't be using tables for layouts and iFrames.

Putcharles
5th May 06, 11:16 PM
Strict, of course.

JamieJelly
11th May 06, 09:18 AM
If you are serving an HTML document with a DOCTYPE with a transitional DTD it will usually be rendered in quirks mode, whilst a strict DTD will result in a page being rendered in standards mode.

Quirks mode emulates the rendering capability of older browsers (MS4,NS4)... why anyone in their right mind would want to do this is beyond me.

Can you guess I use HTML 4.01 with a strict DTD now? :D

fatihturan
11th May 06, 09:55 AM
I'm using xhtml 1.0 strict and i will continue to using this doctype. :)

TechnoPhobe
16th June 06, 01:43 PM
...whatever is right for the job.

...and you should add 'both' as an option in the poll

Jbilsten
16th June 06, 05:18 PM
I try and use Strict when possible (depends on client) so that I don't have to worry about Quirksmode.

iamthez
2nd July 06, 02:28 PM
XHTML strict, always.

EricAsp
15th July 06, 03:06 PM
I vote for Strict, its preferable

dandyna
15th July 06, 03:18 PM
I do use XHTML 1.0 strict

csshuckster
17th July 06, 12:04 PM
1.0 Strict, some Transitional, and with some PHP, 1.1

V.Hormazabal
17th July 06, 10:27 PM
Xhtml 1.0 Strict...and in some circumstances transitional

marks
18th July 06, 12:39 AM
Strict all the way... might as well do the best you can do...

Rufanuf
25th September 06, 12:01 PM
Hi all,

Im new here:) Im somewhat of a beginner with CSS, well webdesing generally infact. I have stumbled across a problem, and wondered ifanyone can help. I found a cool bit of code that allows me to stretch a background image to fit the viewport.

The trouble is when I add ANY doctype to the header of my html page, the script does not function properly it still stretchs the image but instead of fitting it to the viewport it stretchs it below the bottom of the viewport by some 20% to 30%

Does this mean the technique is illegal in all doc types???


Help!!!!

Thanks

Ruf

Game Makker
25th September 06, 05:19 PM
Ermm if it doesn't work corerectly in the doc-type then I wouldnt say it was illegal but just not intended lol.

wizardthemes
4th December 09, 01:57 AM
i use XHTML 1.0 Strict

rkrause
4th December 09, 02:44 AM
For anyone interested in knowing more:
http://www.w3schools.com/tags/tag_DOCTYPE.asp