The intellij linter throws an Empty Tag
-warning:
Reports empty tags (like script ) that do not work in some browsers.The validation works in html or jsp file types.
Which browsers are affected by the problem? How important is it to clear that warning?
The <hr/> and <br/> tag which is used for a horizontal line and line break respectively, doen't contains any content in it and thus are called empty elements in HTML. <p> tag contains text/paragraph in it so it's not an empty element.
An element that does not have an enclosing tag is called an empty element. Adding the closing tags to the empty elements will be invalid syntax. The empty elements don't have any child nodes. In short, Empty elements are self-closing or void and not container tags.
Empty HTML Elements HTML elements with no content are called empty elements. <br> is an empty element without a closing tag (the <br> tag defines a line break). Tip: In XHTML, all elements must be closed.
All browsers except Netscape 4 will allow empty tags.
refer: Is using empty tags valid in HTML5?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With