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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile Doctype declaration

    Hello,
    I've just finished my first website and I'd like to validate it, however, I don't know the 'Doctype declaration'
    I've tried lots of standard ones given by W3C and other helpful HTML websites, however none of them is right.
    You can visit my web for more details http://floatingpenguin.co.uk

    Thanks a lot,
    Inma

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,871
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    It’s not the doctype declaration that is “not right”, it’s the HTML used for that doctype declaration. If you declare your document as strict HTML 4.01 or XHTML 1 then you must only write code that is defined in these strict specifications. On the other hand, there is currently some HTML that is supported in all modern browsers and in fact required for some specific functionality (talk about mobile websites), but which is not part of any standards specification. Therefore, that HTML will never be valid but it works anyway. So you should take validation with a grain of salt. Of course, it should be the ideal but sometimes it’s just not possible and not the end of the world if it doesn’t validate.

    That said, the site at your link doesn’t have any doctype which is the worst of all solutions. Put a standard doctype there and then fix any possible HTML errors.

  • Users who have thanked VIPStephan for this post:

    FloatingPenguin (10-01-2013)

  • #3
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you VIPStephan for your reply, it's very helpful.

    Following your advice I've done a research for standard doctypes and there are quite a few, I wonder if you could recommend me the most appropriate for my web.

    Thanks a lot,
    Inma

  • #4
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,871
    Thanks
    6
    Thanked 1,029 Times in 1,002 Posts
    Well, even though it’s not official yet, the HTML 5 doctype is probably the easiest to implement.
    Code:
    <!DOCTYPE html>

  • #5
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thank you VIPStephan

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Quote Originally Posted by VIPStephan View Post
    Well, even though it’s not official yet, the HTML 5 doctype is probably the easiest to implement.
    Code:
    <!DOCTYPE html>
    Of course you can't use that one for validation as it is allowable to have that doctype on HTML 2 - so you'd still need to choose which version of HTML to validate for separately.
    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.


  •  

    Posting Permissions

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