Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    79
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Question I have a question about DOCTYPEs, please.

    The site I've been working on is mostly all PHP files and has this DOCTYPE:

    Code:
    <!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-US" lang="en-US" dir="ltr" >
    I needed a registration/login feature and found one that works well. I incorporated it into my site but I notice that its native files have this DOCTYPE:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
    That's how the author intended it, apparently and so my question becomes: can these two DOCTYPEs co-exist or must one be conformed to the other? The files for the registration/login feature are in their own directory but my site's files do call for them in forms, etc.

    Am I about to break something?
    Last edited by IAmGrammy; 06-11-2012 at 02:36 AM.

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,620
    Thanks
    0
    Thanked 645 Times in 635 Posts
    The transitional doctype is for web pages originally written using HTML 3.2 that are still in the process of being rewritten to use HTML 4.

    The strict doctype is for pages where all the HTML 3.2 has been removed (or was never there) and so the page is written entirely in HTML 4.

    You can use both on different pages depending on whether your page is still using code that has been obsolete since 1997 or not.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    New Coder
    Join Date
    Apr 2012
    Posts
    79
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Ah..... this wasn't on my radar when I started this thread, but suspicions now arise as to why IE has been stinking up the joint...

    Thanks so much. I'll do a little validating and clean-up, then. (Yay for test sites.)


  •  

    Posting Permissions

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