问题
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