html - CSS 背景无效属性

标签 html css properties background background-color

我正在尝试设置 <header> 的背景颜色标签。然而,这给了我一个错误 Invalid Property在我的检查窗口内。

我的代码(下面)完全没问题。

header {
  background: #009640;
  background: #009640;
  padding: 7px 10%;
}

第一个background给出 Invalid Property .第二行工作得很好。

我试过评论和取消评论这两行,第一行一直给我“无效属性”。

提前致谢。

编辑:我从聊天客户端复制了第一个。第二行是手写的。

最佳答案

当你只设置颜色(一次)时使用background-color

关于html - CSS 背景无效属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36608932/

相关文章:

java - 如果存在命令行值,则覆盖属性文件

python - 为什么Class property.setter不是方法重载的情况?

javascript - 在 .js var 中应用 CSS 样式

html - 使用 CSS 重叠 div 标签

css - 如何让容器扩展以包含 float

c# - 使用 Rhino Mocks 获取属性

javascript - IE8 中空 div 层的 z-index 问题

jquery - 内容可编辑的问题

html - 如何使页脚上的 img 响应?

jquery - @媒体屏幕?不能向下移动框?