locked
Is it time to change the DTD to HTML 5 yet or shall i stick to 4.01S? RRS feed

  • General discussion

  • As you may all be aware of I am a newbie, that is why i am leaning HTML 4.01 strict and not its 'transitional' flavour as I have no legacy Webs to modify. What is the combined wisdom here of selecting the Document Type Declaration of HTML 5 and CSS 3 draft or is it a case of sticking to (HTML 4.01S & CSS 2.1)  until further notice?


    Philip

    Tuesday, March 6, 2012 9:46 AM

All replies

  • First off I wouldn't use 'strict'. That may lead you into problems with different browsers.

    HTML5/CSS3 is definitely the way forward, especially if you have a comsumer-facing site that needs to be mobile friendly. However you will need to use 'shims' (JavaScript functions that provide HTML5 features) for older browsers.

    So, if you are a raw beginner I'd say use 'XHTML transitional' (not HTML 4.01 Transitional) to start with and then explore what HTML5/CSS3 have to offer and what you need to do to use them.

    HTH


    Ian Haynes

    EW - V4 Add-Ins
    EW - Resources, hints and tips
    EW - Design for the Mobile Web

    Tuesday, March 6, 2012 11:14 AM
  • I Think you can use the HTML5 Doctype "HTML"  without any trouble since its backward compatible, but as Ian says if you are going to use HTML5 or CSS3 features then you may have issues and need the shims. I have been using the 5 Doctype and have not seen any issues with old browsers yet but we are not using too many advanced features either.
    Tuesday, March 6, 2012 12:41 PM
  • You've asked this question before, Philip, several times, and the answer is basically the same. As long as there are three different flavors of CSS3 implementation (moz-, webkit-, and "standard," whatever that actually means), as long as javascript is required for support in some browsers (rendering it unusable in the very kind of corporate environments which still run those old browsers, and are also the most likely to also lock down/out javascript on their drones' desktops), and particularly while you are in learning mode, when you are best off learning practices requiring more rigor, such as XHTML, not less, such as HTML5, you should stick with XHTML.

    I agree with Ian that XHTML Strict is not necessary, or even advisable. I never thought it was, and never adopted it. It is an unnecessarily strict, unnecessarily limiting effort to make HTML more strictly conformal with XML, not to make it a "better HTML," and it imposed arbitrary limits on syntax and feature availability that served no definable Web-applicable purpose. Ignore it.

    XHTML Transitional does provide a useful syntactical rigor that encourages good development practices, such as properly closing all elements, correctly nesting all elements, establishing good letter casing practices, and learning generally consistent coding practices for validity and well-formedness. These are all favorable traits, procedures and habits that you'll want to establish in your coding practices while you are learning, and will serve you well as you go forward.

    Furthermore, not incidentally, EW by default provides built-in support in its user interface for helping you to learn these practices and establish these traits. It offers on-the-fly syntax and compatibility checking which will notify you immediately when you have done something wrong (if you work in code view, that is ;-), as well as reports which can provide similar information. Often you will realize that you have erred because the syntax highlighting tells you so (e.g., remove or omit the closing ";" from a CSS rule in the <head> section and note what happens to the color of following rules for that selector), or because of the yellow highlighting or red "squiggly" underline EW provides to holler "Hey, heads up!" when you fail to properly close an element before opening the next, or otherwise create a syntax error in your markup.

    These are very valuable, very useful tools, especially to anyone who is serious about learning this stuff, and I believe you when you have said in the past that this was your objective. For all of these reasons, and for as long as you profess to wish to learn HTML development (as opposed to adopting the next whizbang flavor down the pike), you should stick with XHTML Transitional 1.0. Don't look at it as "switching from this to that," but as "adding this to what I know."

    When is it time for you to adopt HTML5 over XHTML? When you have learned XHTML Transitional (and internalized its good development practices ;-) enough to feel comfortable writing your pages using XHTML and CSS2.1, and it can become an adjunct to your arsenal of develpment tools. Don't even think about learning HTML5 as your primary markup language! Learn HTML5 as an addition to your established toobox, not as your primary toolset. You will then have the best of development environments—well-established coding best practices, upon which is built understanding of the latest in coding methodologies. Now, that's a combination that can't be beat!  ;)

    cheers,
    scott


    Please remember to "Mark as Answer" the responses that resolved your issue. It is common courtesy to recognize those who have helped you, and it also makes it easier for visitors to find the resolution later.

    Tuesday, March 6, 2012 9:33 PM
  • Bob,

    Unless you are using some HTML 5 or CSS 3 feature why bother using a doctype that doesn't have consistent cross browser rendering? If you are using something with CSS 3 then it still doesn't matter if you use XHTML 1.0 Transitional or HTML 5 whether or not the browsers will display consistently. Only if you are actually using HTML 5 elements like <video> or <audio> should you use HTML 5. Then you need to make sure that you  have fallbacks in place for anything that doesn't support that specific element. Video & audio are a pain because even in those browsers that support HTML 5 there is not one single codec that is supported by all the major browser which I define as IE, Firefox, Safari, Opera & Chrome. Remember that only IE 9 has any support for HTML 5 elements so you definitely need a fallback if you have any significat number of visitors that will be using IE 8 or below.


    Free Expression Web Tutorials
    For an Expression Web forum with without the posting issues try expressionwebforum.com

    Tuesday, March 6, 2012 9:53 PM
  • Even if one presently uses no HTML5 or CSS3 features there is no harm in using the HTML5 doctype- it is fully backward compatible. I have seen no effect on older browsers including IE6. Why bother? Well it will be one last thing I will have to change later and I want to validate new pages with it. Also, since I will be incrementally adding features over time it makes sense. Lastly, Zeldman and many other leaders in the field suggest this and from what I have read I agree it makes sense. I think some of the other regulars here do the same.

    Regarding video- We still use flash for now but are looking at 5 for this in order to display on Ipads.

    Tuesday, March 6, 2012 10:38 PM
  • Thanks to one and all; all great advice.

    @ paladyn : At looking at this -> http://en.wikipedia.org/wiki/XHTML I believe you are totally correct in that XHTML 1.0 would teach me good syntax. From here i went to http://www.w3.org/ where i noticed its written in a strict form so i shall adpt its ways - i was going to quote from the film Dune but instead i shall just say thanks for now. I take it XHTML 5 will be the next big thing and preferable over HTML 5 then? 


    Philip


    • Edited by paxmas.eu Wednesday, March 7, 2012 2:04 PM
    Wednesday, March 7, 2012 2:03 PM
  • No Phillip,

    XHTML went to version 1.1 when work was stopped on XHTML 2.0 in favor of HTML 5. Personally unless I'm planning on using HTML 5 features I stick to XHTML 1.0 Transitional and CSS 2.1 or some bits of CSS 3. Until there is more consistent browser support and older browsers are less of an issue I'm not ready to move over to HTML 5 yet. It would be nice since there is much to like but codec and other issues need to be resolved before I'll make it my default choice.

    The reason for using transitional over strict is because some browsers aren't standards complaint and there are things that while not valid work cross browser. Choosing whether or not to use one of them is an individual decision. I always code to strict even though I use transitional just in case some advertiser on one of my client sites isn't as good about coding as I am.


    Free Expression Web Tutorials
    For an Expression Web forum with without the posting issues try expressionwebforum.com

    Wednesday, March 7, 2012 3:17 PM
  • I think its the way strict implies that its better as its to a standard or golden rule; if transitional is used by the people on the coal face, as it were, then its good enough for me.

    Philip

    Thursday, March 8, 2012 2:19 PM