Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
由于 <p> 中的 <br />,我得到了很多验证错误。如果我删除 br 标签,那么它工作正常。
为什么会产生问题?
不是 thebr在里面p,而是你没有以br角色结尾/。您<br>在代码中应该是<br/>. 这就是为什么验证错误是“省略了“br”的结束标签”,它告诉你你没有用 / 正确结束标签。
br
p
/
<br>
<br/>
请注意,在 HTML4 中,不需要br使用最后的斜杠来关闭标签,但在 XHTML 中,它是必需的,因为它是单例标签。