SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Addict
    Join Date
    Jul 2008
    Location
    Port Elizabeth, South Africa
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    doctype + stds mode

    Hi - pls can someone confirm this is correct and will trigger standards mode in IE, never quirks.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />

    thank you! - Val

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, that will trigger 'standards' mode in IE. It will trigger 'almost standards mode' in Opera, Firefox and Safari (unless you serve it properly as an application of XML, which seems unlikely given your HTTP equivalent).

    Note that the Transitional DTDs aren't meant to be used for new documents, though. They are intended for a transitional period only, when you're modernising an old (pre-HTML4) document.
    Birnam wood is come to Dunsinane

  3. #3
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    AutisticCuckoo, that is why I personally choose to use a PHP “header” switch technique which will determine if your browser supports XHTML being served properly, then it will do so, otherwise it will DocType to XHTML 1.0 rather than XHTML 1.1. And it works really well for me, Firefox, Chrome, Safari and Opera all render XHTML 1.1 with the correct “application/xhtml-xml” MIME type, but good ole IE just chooses XHTML 1.0 with the default text-html MIME type extension.

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I do the same on my blog (although if the user agent doesn't prefer XHTML it gets HTML, not XHTML). But it's utterly pointless. If you can use HTML you don't need XHTML and you might as well just serve HTML markup as text/html to everyone.
    Birnam wood is come to Dunsinane

  5. #5
    ¬.¬ shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    @AutisticCuckoo, A possible update to your negotiate method you use on your site. If you have PHP 5+ and access to the HTTP library, could use http_negotiate_content_type() to do all the dirty work. There are also equivalent for charset and language.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  6. #6
    SitePoint Addict
    Join Date
    Jul 2008
    Location
    Port Elizabeth, South Africa
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi - the reason I'm using xhtml transit. + not html 4 strict is because my Wordpress Theme Design book by Tessa Blakeley Silver says it must be xhtml for wordpress. I may transfer all my pages into WP so people can comment. She also says transit is better so people can use markup like <i> and <b> in their blog.

    Otherwise I would've used html strict because Tommy says in his html/xhtml thread that strict anything is better future-proof than transit. anything.

    Is there any other way I should be doing it for wordpress?

    thanks, Val

  7. #7
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by valarcher View Post
    She also says transit is better so people can use markup like <i> and <b> in their blog.
    Those element types are valid in Strict DTDs, too. (Lots of people don't understand what they're for, though, confusing them with <em> and <strong>.)
    Birnam wood is come to Dunsinane

  8. #8
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,234
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    I think Tessa Blakely is using XHTML Transitional because everyone and their brother in WordPress uses XHTML Transitional. I don't think I've seen any other type listed on a Wordpress page.

    It's kinda like, if you get really drunk, you'll allowed to do stupid things because, you know, you're drunk and we don't expect you to do things right. That's kinda what transitional is (for most people, who aren't "transitioning" into anything). I mean, the kinds of things that get allowed with Transitional have no reason to exist in modern web design. Stuff like "align" and <font>.

    The world won't end though if you use transitional. You can write it like strict if you want-- slapping a strict doctype on there then will show no errors. Just because the ruleset you are stating you plan to play by lets lots of handicaps through, doesn't mean your code has to be that bad. I could set every one of my sites to a transitional doctype. They'd all look and act the same everywhere. Nobody but the validator would know the difference.

  9. #9
    SitePoint Evangelist Ed Seedhouse's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, B.C. Canada
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    I think Tessa Blakely is using XHTML Transitional because everyone and their brother in WordPress uses XHTML Transitional. I don't think I've seen any other type listed on a Wordpress page.
    Well it can perfectly well be done, I know because I've done it.
    Ed Seedhouse

  10. #10
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,234
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    But Ed, I haven't seen your WordPress page. People seem to leave them in teh default transistional.

  11. #11
    SitePoint Evangelist Ed Seedhouse's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, B.C. Canada
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    But Ed, I haven't seen your WordPress page. People seem to leave them in teh default transistional.
    If you look around you can find themes in strict document types. There is no actual need for wordpress themes to use transitional since the back end code that the php engine puts out is fine in strict.

    Themes are the worst part of Wordpress IMO. There are no standards to comply with and anyone can hack up a piece of code, call it a theme and stick it on the web. It's hardly surprising that so many of them are so bad.

    Ideally there should be an approval process to go through before they let you publish something claiming to be a WP theme, but I doubt if that is going to happen any time soon.

    Finding a good one is hard and I have yet to find a theme I'm really happy with. That's why I cut one of my own. But there are definitely themes out there using the strict doctype.
    Ed Seedhouse

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,608
    Mentioned
    24 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Ed Seedhouse View Post
    Ideally there should be an approval process to go through before they let you publish something claiming to be a WP theme, but I doubt if that is going to happen any time soon.
    Surely creating a theme that validates as strict is an effective approval process. All you need to do is to promote that your theme uses valid strict HTML which many of the others don't.
    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="^$">


Tags for this Thread

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
  •