SitePoint Sponsor

User Tag List

Results 1 to 24 of 24
  1. #1
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Favor one DOCTYPE over another?

    Should we code to XHTML 1.0 Strict whenever possible, then use the XHTML Transitional when we are forced to? Are all the XHTML DOCTYPES equally acceptable, and we should use whichever one fits the page?

    Thanks!
    Steve

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Use Transitional if you're lazy (like me ), you're updating old pages but can't go "all the way" just yet, or if you need some tag/attribute that's not in Strict.

    I mostly use XHTML 1.0 Transitional, but I've been doing a lot more HTML 4.01 Strict lately.

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that helps. I'll use Strict as much as possible, then back down where applicable.

    Regards,
    Steve

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,861
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    For new web pages the only time you need transitional is NEVER.

    Transitional is only needed for old web pages where you don't have the time to convert then to get rid of the deprecated tags. Tags that are deprecated have been removed because there is a better way to achieve the same result and therefore if you always code everything using the best method for achieving the specific effect you don't ever need to use deprecated tags and hence will not need to create a new page that uses transitional.

    The only circumstance I can think of to use deprecated tags where the better way wont work is in HTML emails where stylesheet support is somewhat lacking (and more so since the release of the new version of Outlook which has far less CSS support than prior versions did)
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks, felgall. I tried to validate my page in XHTML Strict, but it only worked in XHTML Transitional because the Strict did not accept my iframe. I am willing to update all my pages to XHTML 1.0 Strict. Is there a way to make the Strict Doctype accept an include page via an iframe?

    Thanks,
    Steve

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by StevenHu View Post
    Thanks, felgall. I tried to validate my page in XHTML Strict, but it only worked in XHTML Transitional because the Strict did not accept my iframe. I am willing to update all my pages to XHTML 1.0 Strict. Is there a way to make the Strict Doctype accept an include page via an iframe?

    Thanks,
    Steve
    HTML Code:
    <object type="text/html" width="400" height="300" data="/include/mypage.html">
    <param name="src" value="/include/mypage.html"/>
    </object>
    Cross-browser support kind of sucks for this, but it is valid.

  7. #7
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I've switched to use HTML 4.01 Strict exclusively, for two reasons:
    1) XHTML can't be viewed properly (i.e. as XHTML) by about 75 &#37; of all internet users, since IE does not support XHTML delivered as application/xml
    2) HTML 4.01 Strict will eliminate 95 % of all CSS bugs in IE6 and IE7. I'm using only one CSS-sheet with no hacks, and it looks the same in IE and FF for all the functions I've needed so far.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  8. #8
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    In other words, HTML Strict and XHTML Strict doctypes have given you the best cross-browser support. That makes sense, since the Strict version seems to be more "strict" because it insists on the best standards.

  9. #9
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia View Post
    HTML Code:
    <object type="text/html" width="400" height="300" data="/include/mypage.html">
    <param name="src" value="/include/mypage.html"/>
    </object>
    Cross-browser support kind of sucks for this, but it is valid.
    Check out these:
    http://www.aplus.co.yu/web-dev/inser...her-html-page/
    http://intranation.com/test-cases/object-vs-iframe/

    Reasons to Avoid Frames and iFrames
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  10. #10
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Kravvitz,
    Those links are good. I'll try to avoid any iFrames, then. I just want to replace FrontPage's Include bot with valid code. My goal is simple: to place the company info at the bottom of every page by linking to the same "include" content HTML page. I am researching all my options. Evidently an iFrame is overkill and not standards compliant.

    Thanks!
    Steve

  11. #11
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's best to use a server-side include for something like that. PHP includes and SSI are two types of server-side include.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  12. #12
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use a doctype that triggers full standards mode in browsers. Validation is less of an issue, actually; you can always use the "doctype override" feature in the W3C Validator or use another validator altogether.
    Simon Pieters

  13. #13
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,376
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Kravvitz,
    I'll look into SSIs more closely. That seems to be the way to go! I'll get the server admin to advise me on this.

    Thanks,
    Steve

  14. #14
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,115
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    HTML 4.01 Strict will eliminate 95 % of all CSS bugs in IE6 and IE7.
    I wish that were the case..

  15. #15
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,861
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    I wish that were the case..
    That is the case. You only have one million differences to deal with instead of twenty million.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  16. #16
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,115
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Can you explain that some more then, obviously i'm missing something here.

    I thought HTML 4.01 Strict and HTML 4.01 Transitional both use the correct box model ? In fact I have similar bugs in IE consistently using these two doctypes.

  17. #17
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by StevenHu View Post
    In other words, HTML Strict and XHTML Strict doctypes have given you the best cross-browser support. That makes sense, since the Strict version seems to be more "strict" because it insists on the best standards.
    IE doesn't support XHTML, because it can't handle content delivered as application/xml.

    Quote Originally Posted by markbrown4 View Post
    I wish that were the case..
    That is my experience - I haven't found any noticable differences in any of the designs I've made.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  18. #18
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    That is my experience - I haven't found any noticable differences in any of the designs I've made.
    What techniques do you use? Can you show us some examples of your work?
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  19. #19
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Float, absolute and relative positioning, boxes, etc. - whatever CSS I need to build the design.

    Most of them are some which I haven't implemented yet, so I don't really have many online examples (I do have a lot of examples of some work which doesn't work well, because I haven't changed them to HTML 4.01 Strict yet).

    The best example (which doesn't show that much, since it's quite simple splash page I made for a friend, and only exemplifies the box model) is this one:
    With DOCTYPE: http://panzerworld.net/diverse/WARMUSEUMS/index.html
    Without DOCTYPE: http://panzerworld.net/diverse/WARMUSEUMS/quirks.html
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  20. #20
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,115
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    I was talking about the difference between strict and transitional doctypes - not the lack of one and forcing IE into quirks mode..
    HTML 4.01 Strict will eliminate 95 &#37; of all CSS bugs in IE6 and IE7.
    Should this read "A valid doctype will eliminate 95 % of all CSS bugs in IE6 and IE7." ?

  21. #21
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    True, a transitional DOCTYPE would give the same result, but I see little reason to use transitional over strict. My main argument was in regards to XHTML as well, which will pseudo-work in IE7 (though still not properly), but not in IE6 and below.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  22. #22
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,467
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by markbrown4
    I thought HTML 4.01 Strict and HTML 4.01 Transitional both use the correct box model ? In fact I have similar bugs in IE consistently using these two doctypes.
    You are correct mark and the CSS will behave exactly the same in transitional and strict doctypes. There are differences in how things are handled in quirks mode which is a completely different issue because the browser is supporting non standard legacy behaviour.

    There are no css bugs that are fixed in transitional or strict (such as "haslayout" or the double margin bug) because they are also evident in quirks mode.

  23. #23
    bronze trophy
    Join Date
    Dec 2004
    Location
    Sweden
    Posts
    2,670
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    Should this read "A valid doctype will eliminate 95 % of all CSS bugs in IE6 and IE7." ?
    No, there are valid doctypes that trigger quirks mode and there are invalid doctypes that trigger full standards mode.
    Simon Pieters

  24. #24
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,467
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    There is some more info here and here on doctypes and rendering modes .


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •