Results 1 to 7 of 7

Thread: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>

  1. #1

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Resolved [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>

    I am changing my doctypes to html5
    <!DOCTYPE html>
    is the <html> tag still necessary ?
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  2. #2
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Yes.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  3. #3

    Thread Starter
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Thanks
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  4. #4
    Hyperactive Member coothead's Avatar
    Join Date
    Oct 2007
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    285

    Re: When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Hi there isnoend07,

    Actually, the HTML specification explicitly states that the HTML, HEAD and BODY tags are optional.

    These options do not apply to XHTML.

    Source:-


    This example code will validate...
    Code:
    
    <!DOCTYPE html> 
    
    <meta charset="utf-8">
    
    <title>untitled document</title>
    
    Hello world


    ~ the original bald headed old fart ~

  5. #5
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Those links are for HTML4.01, not HTML5

    but you're right in that omitting the html, head, and body tags is still allowed by the HTML5 spec. Keep in mind that IE has a bug relating to omitted tags. And you're much less likely to have rendering problems if you don't omit any tags.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  6. #6
    Hyperactive Member coothead's Avatar
    Join Date
    Oct 2007
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    285

    Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Hi there tr333,

    Personally, I am still coding HTM4.0.1 strict with the html, head and body
    tags included, unless specific HTML5 elements such as video are required.


    ~ the original bald headed old fart ~

  7. #7
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [RESOLVED] When declaring the <!DOCTYPE html> for html5 do you need the <html>

    Quote Originally Posted by coothead View Post
    Hi there tr333,

    Personally, I am still coding HTM4.0.1 strict with the html, head and body
    tags included, unless specific HTML5 elements such as video are required.
    Sure, but the original question did ask about HTML5
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

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



Click Here to Expand Forum to Full Width