如何在<div>?</div>中定位背景图像

时间:2010-03-27 18:11:08

标签: background background-image css

我的代码目前看起来像这样:

<div style="position: fixed; width: 35.25%; height: 6.75%;
    left: 0%; top: 4.625%; right: 64.75%; bottom: 88.625%;
    color: #D1E231; text-align: center; background-color: #666666;
    background-image: url('FleurTR.png'); background-position: right top;">
<div>

<div>显示正常,灰色背景颜色,但背景图像根本不会显示。我在这里错过了什么?没有理由我必须指定背景附件或背景重复,对吧? (我不想重复。)

2 个答案:

答案 0 :(得分:1)

该图片是否正确引用?比如,它不在文件夹中:

background-image: url('/images/myimage.jpg');

答案 1 :(得分:1)

尝试使用从网络链接的图片进行测试。

相关问题