CSS Selector based on background-image
Hi everybody
I got curios about writing a CSS rule that is based on the background-image
I want to selected the property if it is a gif
I want to apply it to background-image.. I have tried a few variation but havent been able to get it right.
Any ideas?
Thanks in advance
:)
I got curios about writing a CSS rule that is based on the background-image
I want to selected the property if it is a gif
Generic selector: a[href$=".gif"]
I want to apply it to background-image.. I have tried a few variation but havent been able to get it right.
body[background-image$=".gif"]
body.style[background-image$=".gif"]
body[backgroundImage$=".gif"]
Any ideas?
Thanks in advance
:)
Comments
background-image is a css property. The only time you could use it in an attribute selector is if you have a web page with something like this HTML:
<body style="background-image: url(example.gif);">
style is an html attribute, you could use but it would be very unusual for background-image to be applied inline like this. If it is applied in a style element or stylesheet like this it won't work:
It is actually applied as an attribute of body (inline style) and not in the CSS
I can easily get to it in a GM script (which I do) but I got curios to see if that is possible to do via style in Stylish.
Thank you for
body[style*=".gif"]{...}
It didn't occur to me
:)
so you must add !important rule in your CSS to override inline style of an element.
Yes, I have added !important rule
:)
http://www.corelangs.com/css/text/image.html
Ling