简体   繁体   English

CSS纹理径向渐变

[英]Css texture radial gradient

I have a problem with radial gradient and texture. 我在径向渐变和纹理方面遇到问题。 I have something like this: 我有这样的事情:

background-image: url('../img/texture.png'); 
/* fallback */ 
background:  -moz-radial-gradient(rgba(253,253,253,0.1) 0%, rgba(237,237,242,0.7) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, color-stop(0%,rgba(253,253,253,0.1)), color-stop(100%,rgba(237,237,242,0.7))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(rgba(253,253,253,0.1) 0%,rgba(237,237,242,0.7) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(rgba(253,253,253,0.1) 0%,rgba(237,237,242,0.7) 100%); /* Opera 11.10+ */
background: -ms-radial-gradient(rgba(253,253,253,0.1) 0%,rgba(237,237,242,0.7) 100%); /* IE10+ */
background: radial-gradient(rgba(253,253,253,0.1) 0%,rgba(237,237,242,0.7) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1adb7c64', endColorstr='#b3dd532f',GradientType=0 ); /* IE6-9 */

but I get radial gradient without that background texture(../img/texture.png). 但是我得到的径向渐变没有该背景纹理(../img/texture.png)。 Anyone know how to do this? 有人知道怎么做吗? Thanks in advance for your answers 预先感谢您的回答

You are overriding the background-image property by assigning new values to background immediately after. 您将通过在此后立即为background分配新值来覆盖background-image属性。

to keep both backgrounds in each case, you should specify both backgrounds in every re-declaration of background , using comma separated notation 要在每种情况下都保留两个背景,则应在每个重新声明的background中使用逗号分隔的符号指定两个背景

example: 例:

background: -webkit-radial-gradient(rgba(253,253,253,0.1) 0%,rgba(237,237,242,0.7) 100%),
                                    url('../img/texture.png');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM