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.
我正在尝试使用 css 为我的搜索栏提供背景。但是 chrome 不断给出错误“无效的属性值”。这很奇怪,因为我的导航栏是完全相同的代码但没有给出错误? http://ispiked.net/tests/
这是因为您还指定了“不重复”以及背景图像。将您的代码更改为:
background: url(images/searchbar.png) no-repeat;
另一种方法是使用 background-repeat 属性。
background-image: url('images/searchbar.png'); background-repeat: no-repeat;