Mozilla Developerhttps://developer.mozilla.org//HTML/Global_attributes/idid id 的值不得包含空格和制表符等空白字符。浏览器会将不符合规范的 ID 中的空白字符视为 ID 的一部分。与允许以空格分隔值的 class 属性不同,元素只能拥有一个 ID 值。idThe purpose of the ID attribute is to identify a single element when linking (using a fragment identifier), scripting, or styling (with CSS). Elements with ID attributes 仅显示来自 developer.mozilla.org 的更多内容请查看https://developer.mozilla.org/zh-CN/docs/Web/HTML/Global_attributes/id