dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: need od body tag in html document

  1. #1
    Join Date
    Jun 2009
    Posts
    97

    need od body tag in html document

    I have created html document with and without body tag and both the times I have got same results in browser. So whats the need of body tag ?

    table_with_body.html
    ---------------------------------------------------------------
    <html>
    <head>Lets try this heading</head><br>Lets print this with body

    tag and see its usability

    <table>
    <body>
    <tr>
    <td>name</td>
    <td>password</td>
    </tr>
    <tr>
    <td>user1</td>
    <td>user1pwd</td>
    </tr>
    </table>
    </body>
    </html>

    table_without_body.html
    --------------------------------------------
    <html>
    <head>Lets try this heading</head><br>Lets print this without body tag and see its usability

    <table>
    <tr>
    <td>name</td>
    <td>password</td>
    </tr>
    <tr>
    <td>user1</td>
    <td>user1pwd</td>
    </tr>
    </table>
    </html>


    In both cases , when I see page in browser, I get same results. So why to use body tag ? In what situation does body tag make a diffrence ?

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    The HTML, HEAD and BODY start and end tags are all optional, as are several other tags. You do need some other things though. See http://www.w3.org/TR/REC-html40/ .
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles