Announcement

Collapse
No announcement yet.

What Are The Consequences of Changing The DOCTYPE?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What Are The Consequences of Changing The DOCTYPE?

    Hey everyone,

    What are the possible negative consequences (if any) if you change the doctype from HTML 4.01 to, say, XHTML 1 or another doc type?

    I ask this because some of the CSS I want to use won't work correctly in Internet Explorer unless it is set to strict mode.

    Thanks in advance.
    Mark Romero
    ~~~~~~~~

    #2
    Re: What Are The Consequences of Changing The DOCTYPE?

    it's hard to predict exactly what the consequences would be, but be ready to do some work in case of problems. If your site was developed with no doctype and you switch it to 4.01/strict, you might see some things break.

    If you want a preview, go to a certain page of your site, view the source code, save it as a new static .html file, and give it the new doctype. Upload it to your site and you should get an idea of what that page would look like.

    Assuming there are problems, the first thing you should do is validate the page (http://validator.w3.org/). Many of the errors listed will be trivial, but many others will be crucial. By the time you fix all the errors you'll probably find that a lot of the display problems are gone. If any are remaining, you'll need to change your code to make it look the way you want, and re-validate afterwards.

    The benefit of doing all this work is you can be a bit more certain that your site will display the same, and correctly, in different web browsers
    Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

    Comment


      #3
      Re: What Are The Consequences of Changing The DOCTYPE?

      If you do mess with that Mark, go here to test your site on different Browsers to make sure things didn't go haywire.

      http://browsershots.org/

      I use this above to check things all the time after my constant tinkering syndrome.
      Last edited by Datagg; 04-26-11, 05:59 PM.
      Dan

      Girlfriends Lingerie - "Keeping It Sexy!"
      Sexy Lingerie - Twitter - Facebook- Pinterest - YouTube

      Comment


        #4
        Re: What Are The Consequences of Changing The DOCTYPE?

        It depends really on where your code is at now as to how it will deal with many of the changes/validations that will be required when you change doctype, as well as the doctype going from and to, including transitional, strict, ect. For example, transitional plays better with deprecated elements and many things can be done willy nilly. Strict is great in dealing with presentation and structure of the site, but tags should be lowercase and definitely closed and some self-closing (ie: <br> versus <br />), plus you need to mind your 'p's and 'q's much more than you do with transitional. Ect, ect.

        Personally, I prefer strict XHTML, but for an HTML or XHTML transitional document to go to an XHTML strict document will require patience and a lot of changes. I've seen some that were fairly easy depending on doctypes switching to and from, but other's code pretty much needed to be scrapped and started from scratch because of doctype differences.

        If you have a good knowledge of CSS and the differences in doctypes in relation to the CSS, it decidedly helps a lot.
        Jamie Donaldson
        JSDVS Web Design / Development
        Web Design | Web Development | E-commerce Design & Integration

        Comment

        Working...
        X