背景图片没有显示任何内容 [英] background image didn't show anything

查看:89
本文介绍了背景图片没有显示任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在css文件中写了以下代码:

 body 
{
padding: 0 ;
保证金: 0 ;
background:url(C:\\\ index.jpg);

字体:14px / 20px Arial,Helvetica,sans-serif;颜色:#3D3C2C;字体重量:正常;
}







还链接来自contact.aspx的css文件,并保留此图片在正确的链接上。



但是当网页加载时它没有显示任何内容。



请把你的ans详细说明



提前致谢...

解决方案

1.创建一个文件夹在你的项目中。

添加 - >新文件夹,将其命名为图像。

2.复制背景图像并将其粘贴到文件夹Images

3.在CSS中,添加

 background:url(〜/ Images / index.jpg); 


 body 
{
padding: 0 ;
保证金: 0 ;
background:url(C:\\USER \\ index.jpg); // 使用'\\',然后就可以使用

字体:14px / 20px Arial,Helvetica,sans-serif;颜色:#3D3C2C;字体重量:正常;
}


i wrote the following code in css file:

body
{
    padding:0;
    margin:0;
     background:url(C:\USER\index.jpg);

    font:14px/20px Arial, Helvetica, sans-serif; color:#3D3C2C; font-weight:normal;
}




also link the css file from contact.aspx, and keep this image on the link properly.

But it doesn't show anything when web page is loaded.

please put your ans in details

Thanks in advance...

解决方案

1.Create a folder in your project.
Add->New Folder, Name it as "Images".
2.Copy your background image and paste it inside the folder "Images"
3.In CSS, Add

background:url(~/Images/index.jpg);


body
{
    padding:0;
    margin:0;
     background:url(C:\\USER\\index.jpg);           //use '\\', then it will work

    font:14px/20px Arial, Helvetica, sans-serif; color:#3D3C2C; font-weight:normal;
}


这篇关于背景图片没有显示任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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