Why doesn't form nested in p validate as XHTML

前端 未结 5 1369
礼貌的吻别
礼貌的吻别 2020-12-10 10:56

Take for instance this XHTML snippet:

         


        
5条回答
  •  眼角桃花
    2020-12-10 11:09

    According to this, because:

    Line 8, Column 44: document type does not allow element "form" here; missing one of "object", "ins", "del", "map" start-tag ✉ The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "p" or "table") inside an inline element (such as "a", "span", or "font").

    Line 9, Column 40: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag input type="submit" value="Hello" The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "p" or "table") inside an inline element (such as "a", "span", or "font").

提交回复
热议问题