18 replies [Last post]
t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 3 weeks 6 days ago
Los Angeles
Timezone: GMT-7
Joined: 2009-09-26
Posts: 209
Points: 268

We all hopefully understand the importance of doc types.

However I am not satisfied with the information I am getting regarding what is the best current method.

I know strict is always the way to go. But there I have read support for both strict XHTM1.0 and HTML3 and 4.

I assume both are good methods. But what is the most modern trend moving forward. Which one do you recommend and why?

STRICT HTML 4.01
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
 
STRICT XHTML 1.0
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

With the reading I have done. Strict XHTML 1 is an XML version of Strict HTML 4.

But why use one or the other? And giving that. Which should you use? I read a long article and started using strict XHTML1. But I am about to embark on an important project and I want to make sure I am moving with the best information.

Thanks in advance!

Tags:
t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 3 weeks 6 days ago
Los Angeles
Timezone: GMT-7
Joined: 2009-09-26
Posts: 209
Points: 268

I got that second doc type

I got that second doc type wrong.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

When the subject is not fully

When the subject is not fully grasped there is only one sane DTD to follow Strict 4.01, do not use XHTML as that requires understanding of why it's wrong to use unless being served correctly, which it never is as text/html.You do not use anything referencing earlier versions of HTML. In time HTML5 might be the flavour we all use and then matters might change but for now it's not a worry.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 1 year 4 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Go with the HTML5 doctype

Go with the HTML5 doctype <!DOCTYPE HTML>. All browsers understand it (doesn't trigger quirks mode in IE), it's easier to remember and uses less bytes. You don't have to use any other features of HTML5 to use the doctype.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 14 weeks 3 hours ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2636
Points: 1554

I use the html5 dtd on my

I use the html5 dtd on my site with no problems.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

That is a Document

That is a Document Declaration as opposed to a DTD. To avoid possible confusion? it's not an HTML5 DTD as there is no formal public identifier.

The Doc Declaration has always existed and triggered full standards mode but as such has no schema against which to validate.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Guru
Milton Keynes
Last seen: 5 weeks 5 days ago
Milton Keynes
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

.. my head hurts

.. my head hurts Shock

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

Not as much as mine does at

Not as much as mine does at the moment!

Hows you doing TPH, hope all is well and good?

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

wolfcry911
wolfcry911's picture
Offline
Guru
MA, USA
Last seen: 28 weeks 5 days ago
MA, USA
Timezone: GMT-5
Joined: 2004-09-01
Posts: 3224
Points: 237

TPH!!!

TPH!!!

CupidsToejam
CupidsToejam's picture
Offline
Guru
Florida
Last seen: 14 weeks 3 hours ago
Florida
Timezone: GMT-4
Joined: 2008-08-15
Posts: 2636
Points: 1554

ToothPaistHangover. Dont ask,

ToothPaistHangover. Dont ask, im in a weird mood

t-bone_two
t-bone_two's picture
Offline
Enthusiast
Los Angeles
Last seen: 3 weeks 6 days ago
Los Angeles
Timezone: GMT-7
Joined: 2009-09-26
Posts: 209
Points: 268

XHTML

Anyone care to weigh in on XHTML strict. And when and why you use it. Would love some good info. Am at the California DMV. They need to post a sign somewhere that says warning we have 50 windows with 100 employees. And at any given time 98 are taking a government ordered nap in the back.

Smee
Smee's picture
Offline
Elder
Adelaide, Oz
Last seen: 1 year 38 weeks ago
Adelaide, Oz
Timezone: GMT+10.5
Joined: 2007-06-10
Posts: 1596
Points: 340

TPH!!!

(To echo Wolfie)...TPH!!!

Wouldn't you just know he'd show up in a Doctype thread? Big smile How are you?

@t-bone_two...have you read Hugo's explanation here?

Mods and gurus – THANK YOU!
For your time, knowledge and experience so willingly and generously given.
Please come back tomorrow and sort us all out again Smile

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 1 year 4 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

Links

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

Is that Top trumps Tyssen

Is that Top trumps Tyssen Smile

I'll remove mine in due course, can't compete with the legend that is Tommy or sitepoint for that matter.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 1 year 4 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

No, just adding some further

No, just adding some further references to the discussion.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

thepineapplehead
thepineapplehead's picture
Offline
Guru
Milton Keynes
Last seen: 5 weeks 5 days ago
Milton Keynes
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

that linky up there that

that linky up there that someone posted wrote:

Not so long ago, most people were advising the use of XHTML1 almost without question, in the belief that it’s little more than a newer implementation of HTML and therefore somehow automatically the ‘better’ option

That sounds like me Laughing out loud I liked XHTML because I liked everything being neat and ordered and organised. Maybe I'm a little bit OCD. Don't really like cAMeLcasE, I think it makes code look messy. I just like everything started and finished and ended. Saying that though, you can do that all in HTML4.01. I don't think I ever set mime types or sent my xhtml pages properly, I just thought the X made it seem cool Tongue

As an aside, I'm good, family and children are well, getting married in June, and have started work as an IT tech in a school in Oxford till the end of March, so have internet on my lunch break for the next few weeks Smile

With no internet for a year and no moneys to buy PC mags (had to cancel my CustomPC subscription) I've lost touch with the technological world a fair bit. Have been checking emails at my folk's house but most other forums and sites I've visited I've not missed . . . . however I've missed this place so much Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

It's good to hear? from you

It's good to hear? from you again, no internet for a year Shock you lucky beggar Smile

Congrats on marriage, cripes it seemed like only days ago that a callow youth was ticking me off for my poor grammar Tongue no it hasn't improved Puzzled

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Guru
Milton Keynes
Last seen: 5 weeks 5 days ago
Milton Keynes
Timezone: GMT+1
Joined: 2004-06-30
Posts: 9668
Points: 801

Surfing in and out of here on

Surfing in and out of here on my lunch breaks Laughing out loud I got to say losing tinternets was probably a good thing ... or I would have lost my soul to WOW Tongue

Back on the subject, how is everything going with doctypes and HTML5? From what I understand it's still being drawn up - but will it mark and end for me banging on about xHtml? Also ... what's a document declaration?

Verschwindende wrote:
  • CSS doesn't make pies

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 2 weeks 2 days ago
London
Timezone: GMT+1
Joined: 2004-06-06
Posts: 15650
Points: 2788

I suppose you could bang on

I suppose you could bang on about (X)HTML 5 or what ever travesty will be touted around - it's all a sodding mess Smile

'Document Declaration' is just that, declare the document, similar to declaring namespaces in XML?

DTD is the 'Document Definition' a collection of declarations.

I had thought that HTML5 had wanted to avoid DTDs or at least public identifiers; not have to formalise the schema, it's why partly I dislike the use of the plain html declaration as without a formal schema one can write whatever one likes.

I couldn't really make much of what Ian Hickie/Hickson? was saying about html5 schemas other than there wasn't one possibly would never be one and a strange assertion that people could write their own - as if many would know how to write a spec?

I get fed up with reading

Quote:

<!DOCTYPE html> the HTML 5 DTD

dotted around the web it's not an HTML 5 DTD it's a document declaration that has existed forever and has always prompted 'Strict' mode and thus seems to be why it's been adopted for temporary? use. I may be wide of the mark on some of this though

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me