我的代码目前看起来像这样:
<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>
显示得很好,背景颜色为灰色,但背景图像根本不会显示。我在这里错过了什么?我没有理由必须指定 background-attachment 或 background-repeat,对吗? (我不想重复。)
最佳答案
是否正确引用了该图片?比如,它不在文件夹中吗:
background-image: url('/images/myimage.jpg');
关于background - 如何在 <div> 中放置背景图片?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2530363/