多背景css3动画
我担心这是不可能做到的,但尽管如此,我认为这是应该能够做到的。
我有一个网页,其中的正文有多种背景(一种是纯色,一种是黑色,但不透明度只有 0.2,第三种是纸张纹理)。这个想法是可以根据某些情况改变纯色(使用 CSS 过渡淡化)。第二层改变不透明度以控制颜色的暗度。
问题是这两个都是独立完成的,我不知道如何更改其中一个背景而无需声明所有背景。
例如 我这样定义原始背景: 背景: url( "overlay.png" ), rgba(0,0,0,0.3), -webkit-gradient(线性,顶部,底部,从(黑色),到(白色));
-注意,我实际上并没有使用 rgba() 因为那不起作用( 多个 CSS 背景、图像上的颜色、被忽略),因此我使用实心渐变。我希望能够执行以下操作:
background: ,rgba(0,0,0,0.6),; 或者 背景-2:rgba(0,0,0,0.6);
这可能吗?
I fear that this can't be done but nevertheless it is something which I think should be able to be done.
I have a webpage where the body has multiple backgrounds (one is a solid colour, one is black but only 0.2 opacity and the third is a paper texture). The idea is that the solid colour can be changed (faded using CSS transitions) depending on certain circumstances. The second layer changes in opacity to manipulate the darkness of the colour.
The problem is both of these are done independently and I don't know of a way to change one of the backgrounds without having to declare them all.
e.g.
I define the original backgrounds like this:
background: url( "overlay.png" ), rgba(0,0,0,0.3), -webkit-gradient(linear,top,bottom,from(black),to(white));
-note that I don't actually use rgba() as that wouldn't work ( Multiple CSS backgrounds, colour over image, ignored ) so I use a gradient that is solid. I want to be able to do something like:
background: ,rgba(0,0,0,0.6),;
OR
background-2:rgba(0,0,0,0.6);
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将多个 div 相互放置,并单独控制它们。
然后你就可以在每一层上单独工作。
或者在 css 中使用多个背景
最后一个是 CSS3,可能缺乏支持
place multiple divs on each other, and control them individually.
then you can work individualy on each layer.
or use multiple backkground in css
last one is CSS3 and might lack support