html page is running without starting it with <html>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jagdeep gupta
    New Member
    • Aug 2010
    • 98

    #1

    html page is running without starting it with <html>

    My html code is running without any error by starting without html tag but html tag is closed at end body tag is not closed still output for <ol> tag is given
    content is written outside any of body, form head still output is shown
    Please Give the reason behind it if anybody knows
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    My html code is running without any error
    HTML code always runs without error. have you tried validating your code?

    besides, in HTML 4 some tags are optional (including <html> and <body>)

    Please Give the reason behind it if anybody knows
    browser developers give their best to display even the crappiest code (somehow).

    Comment

    • jagdeep gupta
      New Member
      • Aug 2010
      • 98

      #3
      Yes sir i know if they dont give any error but output is also not displayed
      But the code is displaying without closing these

      Comment

      • Thew
        New Member
        • Aug 2010
        • 69

        #4
        Show us some code.

        Comment

        • Death Slaught
          Top Contributor
          • Aug 2007
          • 1137

          #5
          Originally posted by jagdeep gupta
          My html code is running without any error by starting without html tag but html tag is closed at end body tag is not closed still output for <ol> tag is given
          content is written outside any of body, form head still output is shown
          Please Give the reason behind it if anybody knows
          The HTML tag is not needed for the browser to display your code. The purpose of the HTML element is simply to tell the browser that the file is an HTML document. The same applies for the other elements. The browser knows that there is a form, table, div, ol, etc and how to display them. However, you should not omit start and end tags.

          Thanks, Death

          Comment

          • jagdeep gupta
            New Member
            • Aug 2010
            • 98

            #6
            Code:
            <ht <h1>Purpose,h1>ml>
            <head>
            <title>
            Expt.com
            </title>
            </head>
            <body>
            </body>
            <font size="40" face="arial"
            Love This place
            </html>

            Comment

            • jagdeep gupta
              New Member
              • Aug 2010
              • 98

              #7
              The above code is working in IE6

              Comment

              • JKing
                Recognized Expert Top Contributor
                • Jun 2007
                • 1206

                #8
                FireFox, Chrome, IE8 all display "Purpose,h1>ml> " and that is it.

                As stated previously all browsers will make an attempt to somehow render even the worst malformed code.

                Comment

                • Death Slaught
                  Top Contributor
                  • Aug 2007
                  • 1137

                  #9
                  Originally posted by JKing
                  FireFox, Chrome, IE8 all display "Purpose,h1>ml> " and that is it..
                  Yes, but the h1 element is still being used on "Purpose,h1>ml> ".

                  Regards, Death

                  Comment

                  Working...