XHTML - What elements are allowed within the element?

后端 未结 5 1537
失恋的感觉
失恋的感觉 2020-12-18 19:33

I know span strong and em. Are there any others? I\'m trying to filter a text which goes inside a link, and need to know what elements

5条回答
  •  攒了一身酷
    2020-12-18 19:52

    For HTML 4.01 Transitional, for instance, you can pick the DTD from w3c site. Then search the in the document and navigate the entities, like %inline; to know the allowed nested elements.

    • #PCDATA is allowed.
    • Through %inline; and %fontstyle;: TT | I | B | U | S | STRIKE | BIG | SMALL
    • Through %inline; and %pharse;: EM | STRONG | DFN | CODE | SAMP | KBD | VAR | CITE | ABBR | ACRONYM
    • ...and so on

    They will, in turn, have other nested elements.

    You can repeat the operation for other HTML DTDs.

    To know how DTDs nesting rules work, I suggest to read a tutorial.

提交回复
热议问题