Re: Can't detect error from this code.

Hi,

It is not an error, as the body tag is optional in HTML. There are other optional features in HTML that you may wish to investigate too. But yeah, not an error. One is not required to write the body tag in there; same with the html tag, and various closing tags are also optional in HTML.

I took your markup and entered the markup into the text field on the W3C's nu validator, and got a pass, but also got a few info messages remarking about the use of the following syntax: " />" when it is recommended to use: ">" in HTML. I just thought I'd mention that as in my opinion one is better to use: ">" in those void elements in HTML rather than the " />" which is really best used only for XML or XHTML (which is XML). So those info messages are because you used <br /> in stead of <br> and in other similar void elements.

Hope that helps.


Best regards,-- 
Dean Edridge 



24 Nov 2022, 20:51 by mohammadmasudrana3396@gmail.com:

>
>
>
>
> <!> doctype>  > html> >
> <> html>  > lang> => "en"> >
>   > <> head> >
>     > <> meta>  > charset> => "UTF-8">  > />
>     > <> title> >> Home Page> </> title> >
>   > </> head> >
>     > <> form>  > action> => "form-action.html"> >
>       > <> h1> ><> strong> >> Fill Up The Form> </> strong> ></> h1> >
>       > <> h5> ><> em> >> Personal Details:> </> em> ></> h5> >
>       > <> input
>         > type> => "text"
>         > name> => "fname"
>         > id> => "fname"
>         > placeholder> => "Your First Name"
>         > required
>       > />
>       > <> br>  > /><> br>  > />
>       > <> input
>         > type> => "text"
>         > name> => "lname"
>         > id> => "lname"
>         > placeholder> => "Your Last Name"
>         > required
>       > />
>       > <> br>  > /><> br>  > />
>       > <> input
>         > type> => "text"
>         > name> => "nick_name"
>         > id> => "nick-name"
>         > placeholder> => "Your Nick Name"
>         > disabled
>       > />
>       > <> br>  > /><> br>  > />
>       > <> label>  > for> => "dob"> >> Date of Birth> </> label> ><> br>  > />
>       > <> input>  > type> => "date">  > name> => "dob">  > id> => "dob">  > />>  > <> br>  > /><> br>  > />
>       > <> input
>         > type> => "email"
>         > name> => "email"
>         > id> => "email"
>         > placeholder> => "Put Your Email Address"
>       > /><> br>  > />
>       > <> br>  > />
>       > <> textarea
>         > name> => "comments"
>         > id> => "comments"
>         > placeholder> => "Put Your Address"
>         > rows> => "7"
>         > cols> => "50"
>       > ></> textarea
>       > ><> br>  > />
>       > <> br>  > />
>       > <> h5> ><> em> >> Other Details:> </> em> ></> h5> >
>       > <> label>  > for> => "fav-color"> >> Choose Your Favourite Color:> </> label> >
>       > <> input>  > type> => "color">  > name> => "fav_color">  > id> => "fav-color">  > />>  > <> br>  > />
>       > <> br>  > />
>       > <> label>  > for> => "graphics-design"> >> Select Graphics Design> </> label> >
>       > <> select>  > name> => "graphics_design">  > id> => "graphics-design"> >
>         > <> option>  > value> => ""> >> Select> </> option> >
>         > <> option>  > value> => "photoshop"> >> Photoshop> </> option> >
>         > <> option>  > value> => "Adobe Illustrator"> >> Adobe Illustrator> </> option> >
>         > <> option>  > value> => "Adobe After Effects"> >> Adobe After Effects> </> option> >
>         > <> option>  > value> => "Acrobat"> >> Acrobat> </> option> >
>         > <> option>  > value> => "XD"> >> XD> </> option> >
>         > <> option>  > value> => "RoboHelp"> >> RoboHelp> </> option> >
>         > <> option>  > value> => "Animate"> >> Animate> </> option> >
>         > <> option>  > value> => "Creative Cloud"> >> Creative Cloud> </> option> >
>         > <> option>  > value> => "Lightroom"> >> Lightroom> </> option> >
>         > <> option>  > value> => "Stock"> >> Stock> </> option> >
>       > </> select> >
>       > <> br>  > />
>       > <> br>  > />
>       > <> label>  > for> => "web-design"> >> Select Web Design> </> label> ><> br>  > />
>       > <> select>  > name> => "web design">  > id> => "web-design"> >
>         > <> option>  > value> => ""> >> Select> </> option> >
>         > <> option>  > value> => "HTML"> >> HTML> </> option> >
>         > <> option>  > value> => "CSS"> >> CSS> </> option> >
>         > <> option>  > value> => "Javascript"> >> Javascript> </> option> >
>       > </> select> >
>       > <> br>  > />
>       > <> br>  > />
>       > <> label>  > for> => "web-development"> >> Select Web Development> </> label> >
>       > <> select>  > name> => "web_development">  > id> => "web-development"> >
>         > <> option>  > value> => ""> >> Select> </> option> >
>         > <> option>  > value> => "Phython"> >> Phython> </> option> >
>         > <> option>  > value> => "Ruby"> >> Ruby> </> option> >
>         > <> option>  > value> => "Bootstrap"> >> Bootstrap> </> option> >
>         > <> option>  > value> => "PHP"> >> PHP> </> option> >
>         > <> option>  > value> => "JQuery"> >> JQuery> </> option> >
>       > </> select> >
>       > <> br>  > />
>       > <> br>  > />
>       > <> h5> ><> em> >> Further Information:> </> em> ></> h5> >
>       > <> label>  > for> => "pet-name"> >> Pet Name> </> label> >
>       > <> input>  > type> => "text">  > name> => "pet_name">  > id> => "pet-name">  > maxlength> => "6">  > />>  > <> br>  > />
>       > <> br>  > />
>       > <> br>  > />
>       > <> br>  > />
>       > <> h4> ><> strong> >> Read This Before submit:> </> strong> ></> h4> >
>       > <> p> >
>         > <> em
>           > >> Generally, we may collect and use personal information for many
>           purposes, including, but not limited to: billing, product and service
>           fulfillment, understanding customer needs, providing a better website,
>           improving products and services, and communicating with customers and
>           potential customers regarding our products and services with
>           third-party products and services.> </> em
>         > >
>       > </> p> >
>       > <> br>  > />
>       > <> br>  > />
>       > <> input
>         > type> => "text"
>         > name> => "register"
>         > id> => "register"
>         > value> => "Thanks for Registar"
>         > readonly
>       > />
>       > <> br>  > />
>       > <> br>  > />
>       > <> input>  > type> => "submit">  > name> => "submit">  > value> => "Submit">  > />
>       > <> input>  > type> => "reset">  > name> => "reset">  > value> => "Reset">  > />
>     > </> form> >
>   > </> body> >
> </> html> >
>
> This Code has an error. The body opening tag is missing but the w3 validator can't detect this error. please check your system and resolve the issue thank you.
>
> Thanks & regards,
> Masud Rana Shawn 
>
>
>

Received on Monday, 28 November 2022 13:46:16 UTC