如何在内放置背景图像?
我的代码目前如下所示:
<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>
显示得很好,背景颜色为灰色,但背景图像根本不会显示。我在这里缺少什么?我没有理由必须指定背景附件或背景重复,对吧? (我不想再重蹈覆辙。)My code currently looks like this:
<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>
The <div>
shows up just fine, with the grey background color, but the background image won't show up at all. What am I missing here? There's no reason I should have to specify background-attachment or background-repeat, right? (I don't want it to repeat.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该图像引用是否正确?就像,它不是在文件夹中吗:
Is that image referenced correctly? Like, is it not in a folder:
尝试使用从网络链接的图像来测试它。
Try testing it with an image linked from the web.