为什么背景图片不显示在这里? [英] why is the background image not showing here?

查看:275
本文介绍了为什么背景图片不显示在这里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我不知道为什么这根本不起作用。它看起来像我的代码应该是这样,有人可以告诉我为什么我的背景图片显示不正确?



http://imgur.com/V6X4u

  body {
font-family:arial;
font-size:14px;
background-image:url('worn_dots.png');
background-repeat:repeat;
}

由于某些原因,当我用网址替换URL时,背景显示,但是这样它不。

解决方案

编辑:



根据您的屏幕截图,在css文件夹中,所以在css中像这样路径图像:

  background-image:url(../ worn_dots.png )

由于您的图片出现在根文件夹中,并且 css prenst在css文件夹中,所以使用 ../ 将图片与css相关联

okay, i have no idea why this isn't working at all. it seems like my code is the way it should be, can someone show me why my background image isn't showing correctly?

http://imgur.com/V6X4u

body {  
     font-family:arial;
     font-size:14px;
     background-image:url('worn_dots.png');   
     background-repeat:repeat;
     }

For some reason, when I replace the URL with a web address, the background shows, but like this it doesn't.

解决方案

EDITED:

According to your screen shot your css is inside in css folder, so path your image in css like this:

background-image:url(../worn_dots.png)

As your image is present at root folder and css is prenst in css folder, so use ../ to relate your image in css

这篇关于为什么背景图片不显示在这里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆