问题
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