Is it safe to omit and tags?

后端 未结 10 2060
广开言路
广开言路 2020-12-05 22:41

According to w3c and tags are optional, so the following table is perfectly valid.



        
                      
相关标签:
10条回答
  • 2020-12-05 23:26

    I advise always closing your tags. There's not really too good of a reason not to. Browsers can handle some improperly closed tags, but just to be on the safe side (and it's good programming practice!), close your tags!

    0 讨论(0)
  • 2020-12-05 23:28

    Certainly if you are using only HTML there is absolutly no problem thats not the case with XHTML nevertheless i don't think you can get that much, also i suggest dont abuse tables remember div are better than tables

    0 讨论(0)
  • 2020-12-05 23:31

    I strongly recommend against doing that, though it is valid in HTML4 (and 5). The bandwidth savings are miniscule when compared to the technical debt you are incurring. Also keep in mind it is not valid in XHTML, so be sure your doctype is set appropriately.

    0 讨论(0)
  • 2020-12-05 23:32

    This is valid HTML but invalid XHTML.
    There's nothing intrinsically wrong with it.

    If you look at the source for Google's privacy policy (or any of their other pages), you'll find some much terser HTML.

    It does mean that your page will not be usable by an XML parser.

    0 讨论(0)
提交回复
热议问题