覆盖线性渐变CSS属性 [英] Override linear gradient CSS attribute

查看:60
本文介绍了覆盖线性渐变CSS属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下类定义:

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

但是,该网站的javascript(我无法影响)在后台添加了 linear-gradient 属性:

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);

现在,没有javascript,只能通过CSS,如何覆盖属性,例如:无效其效果?

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

我用Google搜索它,发现在原始类定义中添加了 filter:none!important; ,但这是行不通的.其他建议包括添加 background-image:none ,但我想保留背景图像.

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.

推荐答案

您可以尝试在CSS工作表中添加以下两行:

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

这篇关于覆盖线性渐变CSS属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆