While reading this W3C document , I came across a part that made me curious:
Similarly, just as natural languages ​​have grammatical rules for how different words can be used, HTML has rules for where and how each element and attribute can be used.
Which can be translated as:
Similarly, just as natural languages ​​have grammatical rules for how different words can be used, HTML has rules for where and how each element and attribute can be used.
Logically I understand that HTML is not like languages ​​like JavaScript or Java. So my question is:
Does HTML have a mathematical logic to position the elements in a logical (mathematical) way and order so that the document makes current sense? Or is it just a hierarchical order of the DOM? (because I believe that the text refers to the logical plot that a web page has in the DOM)
Could someone expert in HTML5 explain it to me?
In the same paragraph from which you extracted the quote you mention, it also says:
HTML you have elements for:
The above is the vocabulary of HTML; via tags
In the same way, the cited document indicates that:
So it is important to distinguish that HTML gives us a syntax to create a markup structure through its tags; which are interpreted by the render engine of each browser.
It is also important to know that there are rules to know which labels may or may not contain others.