Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Empty <title> element in HTML stops HTML from loading if written as <title />

Tags:

html

Probably a really dumb question - but in an HTML document, why does the following:

 <title></title>

work ok (according to http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_basic)

but then

<title />

will stop the HTML from rendering?

Thanks

like image 629
Scotty Avatar asked Jan 13 '23 03:01

Scotty


1 Answers

As stated in the HTML specification:

The title element must not be empty.

It also states:

Note: If it's reasonable for the Document to have no title, then the title element is probably not required.

like image 154
James Donnelly Avatar answered Jan 31 '23 00:01

James Donnelly