gpt4 book ai didi

html - Bootstrap CSS - 无法同时获取背景颜色和图像

转载 作者:太空宇宙 更新时间:2023-11-03 19:04:47 24 4
gpt4 key购买 nike

我将 Bootstrap 与 Rails 结合使用,但无法同时显示背景颜色和图像。我有一个自定义 CSS 样式表,我试图在其中编辑正文以在右下角有一个带有小图像的深色背景,如下所示:

body {
padding-top: 55px;
background-color: #2e2e2e;
background-attachment: fixed;
background-image: url('waves.png');
background-repeat: no-repeat;
background-position: right bottom;
}

问题是图片不显示,只显示背景。如果我删除“背景颜色”,它会显示出来并且看起来很完美,但我无法将它们组合在一起。我知道我遗漏了一些小东西(可能也很愚蠢)。感谢您的帮助。

最佳答案

你试过这种方法吗?

body {    
padding-top: 55px;
background: #2e2e2e url(waves.png) right bottom no-repeat;
background-attachment: fixed;
}

关于html - Bootstrap CSS - 无法同时获取背景颜色和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10767641/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com