CSS背景图像未加载 [英] CSS Background image not loading

查看:35
本文介绍了CSS背景图像未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了所有的教程,这些教程都是说的.我在我的 css 样式表中指定了 body 内的背景,但页面只显示空白的白色背景.图像与 .html 和 .css 页面位于同一目录中.教程说

I have followed all of the tutorials, which all say the say thing. I specify my background inside of body in my css style sheet, but the page just displays a blank white background. Image is in the same directory as the .html and the .css pages. The tutorial says that

<body background="image.jpeg">

已弃用,因此我在 css 中使用

is deprecated, so I use, in css,

body {background: url('image.jpeg');}

没有成功.这是整个 CSS 样式表:

no success. Here is the entire css style sheet:

body 
{
background-image: url('nickcage.jpg');
padding-left: 11em;
padding-right: 20em;
font-family:
Georgia, "Times New Roman",
Times, serif; 
color: red;        
}

推荐答案

这是另一个图像 url 结果..工作正常...我只是放了一个图像路径..请检查它..

here is another image url result..working fine...i'm just put only a image path..please check it..

菲德尔:http://jsfiddle.net/287Kw/

body 
{
background-image: url('http://www.birds.com/wp-content/uploads/home/bird4.jpg');
padding-left: 11em;
padding-right: 20em;
font-family:
Georgia, "Times New Roman",
Times, serif; 
color: red;


}

这篇关于CSS背景图像未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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