Ravi Ubana
Ravi Ubana

Reputation: 395

Using html tags without <html> tag?

So i have an example , In my example.html ,I am using

<h1>example</h1>

While running with browser it is giving correct output. But still I am finding how these tags works without <html> tag.

My finding says -

Is there any other valuable answer regrading this?

Upvotes: 1

Views: 156

Answers (1)

Quentin
Quentin

Reputation: 943563

The specification defines the HTML element as having start and end tags that may be omitted.

If you don't include them explicitly, the parser is required to imply the start and end of the element from context (which it can do unambiguously).

An html element's start tag can be omitted if the first thing inside the html element is not a comment. An html element's end tag can be omitted if the html element is not immediately followed by a comment.

Upvotes: 1

Related Questions