CSS 中 cursor: pointer 需配合伪类 :hover 使用直接在 button 元素上声明不会生效正确做法是为 button:hover 单独设置该样式。 css 中 cursor: pointer 需配合伪类 :hover 使用直接在 button 元素上声明不会生效正确做法是为 button:hover 单独设置该样式。在 CSS 中cursor 属性用于定义鼠标指针在元素上方时的形状。虽然 cursor: pointer 常被误认为可“默认启用”于可交互元素如 button但浏览器默认已将 button 的 cursor 设为 pointer——因此多数情况下无需额外设置。但若自定义样式覆盖了默认行为例如重置了 all: unset、或父级设置了 cursor: default或希望显式强化交互反馈则必须通过 :hover 伪类精准控制。? 正确写法如下button { margin: 10px; padding: 5px; background-color: lightsalmon; width: 20%; font-weight: bold; color: white; border: 1px double dodgerblue; border-radius: 3px; /* 注意此处不写 cursor: pointer */}/* 关键修复为悬停状态单独声明 */button:hover { cursor: pointer;}?? 注意事项 Ideogram Ideogram是一个全新的文本转图像AI绘画生成平台擅长于生成带有文本的图像如LOGO上的字母、数字等。