html - 使用 rgba 作为背景图像

标签 html css

<分区>

Possible Duplicate:
Translucent background from opaque image

我想使用 rgba,但我没有坚实的背景,因为我使用的是图像。是否可以将图像不透明度设置为部分微弱,然后在内部包含一个 100% 不透明度的 div 而没有任何继承。

#container2 {


position: absolute;
margin-top: 0px;
    height: 600px;
margin-top: 50px;
margin-left: 0px;
margin-right: 50px;
    width: 1000px;
background-image:url(../images/container2_yellow_nailed.png);
 } 

最佳答案

目前CSS不支持控制背景图片的不透明度。

您可以通过使用具有相同尺寸、指定 opacity 并将定位在您的元素下方的额外元素来实现类似的效果。

关于html - 使用 rgba 作为背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14164777/

上一篇:html - 不能中心形式?

下一篇:html - overflow-x 拒绝显示?

相关文章:

html - 在所有页面上插入菜单选项卡 - HTML 和 CSS

javascript - 如何使用 jquery 为某个 div 添加谷歌翻译器

javascript - 当所有 child 都没有显示时如何隐藏上部div

jquery - 使整个页面变暗但突出显示某些区域

CSS :not problem when body or * is specified in style

c# - 单列中新行上的删除和编辑按钮

javascript - 在 Div 中为背景图像应用颜色

HTML/CSS : How to move my navigation bar to the middle?

javascript - 在拇指顶部显示 slider 范围值

php - 相对 Div 内的绝对 Div 的响应高度