Block images within css element?

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
Hanibal
Posts: 6
Joined: Sat Apr 19, 2008 4:16 am

Block images within css element?

Post by Hanibal »

Let's say there's a css class being used all over the place (say as a generic padding div), and placed in one of the divs is an ad image being displayed.

Could I write a filter that says to block images in that class, but not block the class itself?
Thanks
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Sure:
Using this page as an example:
The following blocks the "New Topic" image button on the bottom-left on this topic page that is inside the SPAN(class="nav"}. It removes it without disturbing the rest of the class info.

Code: Select all

adblockplus.org##SPAN.nav IMG[src*="/post.gif"]
Is that what you want?

EDIT:
ps. But why wouldn't you just block the image's address itself and not worry about what class it is in? ... unless you need to do it that way?
Hanibal
Posts: 6
Joined: Sat Apr 19, 2008 4:16 am

Post by Hanibal »

Perfect, thanks dude. To answer your query, the ad images change every week and also I can't block all images from the site becausae some of them are layout images.

Another question for you: can adblock add css styles?
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Sure can. Try adding and playing with the Element Hiding Helper extension for ABP. If you have a little html and/or css knowledge, it makes css hiding solutions MUCH easier to deal with. It takes a little getting used to, but works great!

Hint: Use the "W" and "N" keys to pinpoint your selection on the page.
https://addons.mozilla.org/en-US/firefox/addon/4364
Hanibal
Posts: 6
Joined: Sat Apr 19, 2008 4:16 am

Post by Hanibal »

I tried the extension but now I think I didn't convey my question properly. What I meant was, could adblock (or the EHH) add a css style to be applied to the page's layout?

For instance, this board's background is white. Could I create a rule that would add a css style to the page's styles to make the background red?
THANKS
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

Hanibal wrote:I tried the extension but now I think I didn't convey my question properly. What I meant was, could adblock (or the EHH) add a css style to be applied to the page's layout?

For instance, this board's background is white. Could I create a rule that would add a css style to the page's styles to make the background red?
THANKS
No. ABP only removes items. For modifying elements, you might want to try the Stylish extension:
https://addons.mozilla.org/en-US/firefox/addon/2108
Hanibal
Posts: 6
Joined: Sat Apr 19, 2008 4:16 am

Post by Hanibal »

YES, thanks Rick! Have a great weekend!
Locked