Where in the world are are the HTML nesting rules? [closed]

删除回忆录丶 提交于 2021-02-07 04:55:10

问题


Can someone provide a link to a document that has all HTML (preferably HTML5) nesting rules?

For example: you can't put a <div> inside a <p>.

Thanks!


回答1:


See the HTML 5 specification. Take, for example, the p element.

The Content Model will tell you what it can contain. In this case: "Phrasing content.", which links to a list of elements interspersed with exceptions.




回答2:


Not. Html5, but http://www.cs.tut.fi/~jkorpela/html/nesting.html is a useful list in the form I think you want. Absurdly complicated....




回答3:


Here's the link to the xhtml 1 spec.



来源:https://stackoverflow.com/questions/5997254/where-in-the-world-are-are-the-html-nesting-rules

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!