你能给CSS3渐变添加噪声吗? [英] Can you add noise to a CSS3 gradient?
本文介绍了你能给CSS3渐变添加噪声吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在CSS中为渐变添加噪声?
这是我的径向渐变代码:
body {
color:#575757;
font:14px / 21px Arial,Helvetica,sans-serif;
background-color:#2f3b4b;
background:-moz-radial-gradient(center 45deg,circle closest-corner,#2f3b4b 0%,#3e4f63 100%);
background:-webkit-gradient(径向,中心中心,10,中心中心,900,从(#2f3b4b)到(#3e4f63)
}
我会添加什么,它的纹理?
解决方案
css中没有当前的方式来添加noise b
另一种解决方案是在图形编辑器中创建一个透明的噪声png。然后将该图形应用为< div>
的背景。然后,您需要在< body>
的整个区域放置< div>
给出具有噪声的梯度的外观。
Is it possible to add noise to a gradient in CSS?
Here is my code for a radial gradient:
body {
color: #575757;
font: 14px/21px Arial, Helvetica, sans-serif;
background-color: #2f3b4b;
background: -moz-radial-gradient(center 45deg, circle closest-corner, #2f3b4b 0%, #3e4f63 100%);
background: -webkit-gradient(radial, center center, 10, center center, 900, from(#2f3b4b), to(#3e4f63));
}
What would I add to that to have noise on top of it, to give it texture?
解决方案
There's no current way in css to add 'noise' to a background.
An alternative solution would be to create a transparent noise png in your graphic editor. Then apply that graphic as a background to a <div>
. You would then need to place that <div>
over the entire area of the <body>
which should then give an appearance of a gradient with noise.
这篇关于你能给CSS3渐变添加噪声吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文