简体   繁体   English

使用CSS设置背景图片不会加载背景图片

[英]Set background image using css don't load the background image

I get a console error when I try to set a background image using CSS. 当我尝试使用CSS设置背景图片时,出现控制台错误。

My CSS code is: 我的CSS代码是:

body {

background-image: url("background.png");
background-repeat: no-repeat;}

The error 错误

GET http://localhost/myWeb/css/background.png 403 (Forbidden).

The CSS file and the image are in the same location. CSS文件和图像位于同一位置。

您应检查image background.png ..的文件权限。

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

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