简体   繁体   English

CSS 无效属性值-背景图

[英]CSS Invalid Property Value-Background-image

I'm currently learning some CSS and have run into an error when it comes to my background image.我目前正在学习一些 CSS 并且在涉及我的背景图像时遇到了错误。 I put in the CSS and when I go to inspect it, Developer tools tells me that it is an "invalid CSS property value".我输入了 CSS,当我检查 go 时,开发者工具告诉我这是一个“无效的 CSS 属性值”。 I've checked to be sure my image path is correct and have looked to see if background-image as a property has changed.我已检查以确保我的图像路径正确,并查看了作为属性的背景图像是否已更改。 Any tips would be appreciated.任何提示将不胜感激。 Thanks.谢谢。

 body, html { width: 100%; height: 100%; font-family: 'Permanent Marker', cursive; background-image: url ("header2.jpeg") no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }.btn { background-color: orangered; }

Snippet from developer tools:来自开发者工具的片段:

开发者工具图片

You can't list the values without the property names... Something like this:你不能列出没有属性名称的值......像这样的东西:

background-image: url('path');
background-repeat: no-repeat, repeat;
background-attachment: fixed;
background-position: center;

Inline CSS Background has some rule- background: bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;内联 CSS 背景有一些规则background: bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit; You have to follow this rule.你必须遵守这个规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM