Is there an overall hierarchy of elements? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is there an overall hierarchy of elements?

In terms of nesting them. I know codepen tends to flag some as errors

25th Aug 2016, 11:35 PM
Sebastien Logan
Sebastien Logan - avatar
2 Answers
+ 2
Yes there is in terms of sandwiching your elements together. For example you cannot have your closing body tag after your ending html tag. Everything has an order and if you stick to it you will find out that html isnt that hard after all. Hierarchy is especially important with div tags and creating a sense of organization. In terms of hierarchy as one tag is more important than the other than no. No such hierarchy really exists.
26th Aug 2016, 2:54 AM
Kris
- 1
After html, head, and body tag, no hierarchy is really needed or mandatory. You can just write the tag inside any tag as you wish. But sure you can not just put heading inside paragraph. It's only a matter of making document cleaner and better structured
1st Sep 2016, 1:07 AM
Ahmad Syarif
Ahmad Syarif - avatar