Override linear gradient CSS attribute

倖福魔咒の 提交于 2021-01-28 06:24:56

问题


I have the following class definition:

height: 99px;
width: 961px;
padding-top: 40px;
font-size: 15px;
color: rgb(255, 255, 255);
background: no-repeat url(data:image/png;base64,h64GFj4fhffGFHJJ74fhf);

However, the site's javascript (which I can't influence) is adding a linear-gradient property to the background:

height: 99px;
width: 961px;
padding-top: 40px;
font-size: 15px;
color: rgb(255, 255, 255);
background: linear-gradient(rgba(0, 153, 204, 0.701961) 0%, rgba(0, 153, 204, 0.701961) 100%) no-repeat, url(data:image/png;base64,h64GFj4fhffGFHJJ74fhf);

Now, without javascript, only through CSS, how can I override property, as in: nullify its effect?

I googled it and what I found is adding filter: none !important; to my original class definition, but that doesn't work. Other suggestions include adding background-image: none, but I want to keep my background image.


回答1:


You may try to add these two lines in the css sheet:

background: none !important;
background: no-repeat url(data:image/png;base64,h64GFj4fhffGFHJJ74fhf) !important;

Ugly but I think it may work



来源:https://stackoverflow.com/questions/32481018/override-linear-gradient-css-attribute

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!