SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Member
    Join Date
    Nov 2003
    Location
    London
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Do I need a DOCTYPE Declaration?

    Hello,

    I have never used a DOCTYPE declaration up until now, but wondered if I should. I create html using [whispered] FP2000 which doesn't bother with a doctype.

    When I have validated any of my work with W3C, I usually get the least amount of errors when I specify 'HTML 4.01 Transistional'.

    Is the DOCTYPE specific to the type of html I produce or the HTML editor that I am using? Is there an article somewhere that will explain this to me in simple terms?

    For example Doctypes For Dummies !!!!!!!!!!!!!

    Thanks

  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)
    http://alistapart.com/articles/doctype/ should explain everything for you.

  3. #3
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, DOCTYPES are a good thing.

  4. #4
    SitePoint Member
    Join Date
    Nov 2003
    Location
    London
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    http://alistapart.com/articles/doctype/ should explain everything for you.
    Thanks, I have looked at this document on ALA and it is v helpfull. It suggests using either:

    HTML 4.01 Strict, Transitional or Frameset
    XHTML 1.0 Strict, Transitional or Frameset
    XHTML 1.1

    Which do I choose? I use some basic css and I don't use frames, will the fact that I use FP2000 influence the DOCTYPE?

    Thanks

  5. #5
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    The fact that you use FP2000 shouldn't influence the DOCTYPE. Just turn off code correction . I suggest using HTML 4.01 Transitional or XHTML 1.0 Transitional if you're rather new at building pages.

  6. #6
    SitePoint Member
    Join Date
    Nov 2003
    Location
    London
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vinne, sorry to be borring, but what is the difference between HTML 4.01 Transitional or XHTML 1.0 Transitional?

    Thanks

  7. #7
    SitePoint Wizard
    Join Date
    Mar 2002
    Location
    Bristol, UK
    Posts
    2,240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XHTML is just a new version of HTML, with more of structure, and more rules that you have to follow.

    For example, in HTML, you may use <br>, but in XHTML you have to use <br /> - the idea is that all tags have a closing slash.

    For more info on (X)HTML, you could visit http://w3.org

    Hope this helps!

    -Sam
    Sam Hastings

  8. #8
    ☆★☆★ 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 iangould
    Thanks Vinne, sorry to be borring, but what is the difference between HTML 4.01 Transitional or XHTML 1.0 Transitional?

    Thanks
    Not too many differences really, except you have to follow the rules of XML as well as HTML. Here are the big things to look out for:
    1. All tags must be lowercase, since XML tags are case-sensitive. This means that <a> is different from <A>.
    2. All tags must be well-formed, meaning you have to close them all. For tags like <hr> and <br> that don't have closing tags in HTML 4, you use a self-closing tag like <br /> and <hr />.
    3. Attributes cannot be minimized. <option selected> isn't valid anymore, now it has to be <option selected="selected"> and so on.

  9. #9
    SitePoint Addict CeleronXL's Avatar
    Join Date
    Dec 2002
    Location
    United States of America
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.w3schools.org/ is probably a better place to actually learn to code XHTML than W3.org.
    So hold me when I'm here
    Right me when I'm wrong
    Hold me when I'm scared
    Love me when I'm gone.

  10. #10
    SitePoint Member
    Join Date
    Nov 2003
    Location
    London
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone for your help (the w3schools site looks good).

    One question though, why should I bother using XHTML 1.0 Transitional if it means I need to correct all the missing closing tags produced by FP2000?

    Is it that it will display better or that more browsers will display it or what?

  11. #11
    Ensure you finish what you sta bronze trophy John Colby's Avatar
    Join Date
    Aug 2003
    Location
    University of Central England, U.K.
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by iangould
    One question though, why should I bother using XHTML 1.0 Transitional if it means I need to correct all the missing closing tags produced by FP2000? Is it that it will display better or that more browsers will display it or what?
    HTML 4 is no longer being developed - XHTML is. And although currently there's no advantage, in the future there probably will be.

    You can use a global search/replace function like bk-replace - http://www.orbit.org/replace/ - free - to change the tags.

    And you could also try (also free) HTML-Kit - http://www.chami.com/html-kit which recognises XHTML and has built in HTML-Tidy - you can clear up any other stuff that Frontpage has thrown at you as well. IHMO Frontpage gives you code that works in IE - but puts in or leaves out important things that would make your code standards compliant - a problem if you want to make your code accessible and usable across a wide range of devices.
    John
    No electrons were harmed during the creation, transmission
    or reading of this posting. However, many were excited and
    some may have enjoyed the experience.


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
  •