id属性是一个全局属性。 是的,你可以在head元素中使用id属性。此外,以下是全局属性的完整列表,它们可以被指定在所有HTML元素上。 accesskey class contenteditable dir hidden id lang spellcheck style tabindex title translate