3 ms·
With HTML you define a tree of elements. And you assign IDs and classes to those elements. How is that not well suited to build a logical structure?
by TekMol 6y ago
With HTML you define a tree of elements. And you assign IDs and classes to those elements.
How is that not well suited to build a logical structure?
- kevincox 6y agoBecause HTML (excluding web components which require JavaScript) doesn't have any way to handle repetition and conditionals. Of ccourse the commenter does mention using a templating language but a lot of people will be annoyed with this basic language and just want the full lower of JS to generate the site structure.
- tonyedgecombe 6y agodoesn't have any way to handle religion <a religion="christian" href="...
- kevincox 6y agoFixed to repetition.
- valenterry 6y agoBecause it is too powerful. You can do something like this: <div class="main"> oh <div class="sub"> hello </div> </div> This is valid HMTL but it is not a valid structure in any context that I could imagine, because what is the "oh" supposed to do there? To prevent these (and other) mistakes, the way you can build up the structure should be restricted in a meaningful way and certainly not allow text and random positions and similar things. You could then describe this with a subset of HTML, but there isn't really any reason to choose it, except for "I'm used to it". Better choose your native programming language. And if it is not better than a HTML subset, maybe consider choosing your language.