Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
413 views
in Technique[技术] by (71.8m points)

html - AdBlock plus hids elements with ids or class with the word "ad"

I have two divs in my site one with id ad_holder and another with id ad_buttons"

When testing the site on Mozilla with ad block plus installed I noticed that both divs were hidden. On further inspection I noticed it that Adblock was the culprit probably because of the ID names. I also noticed that Adblock created (or maybe has a ready made) CSS file, that sets the display to hidden.

I know I can fix this by simply changing the IDs or trying to override the Adblock CSS but still need to know if there is yet another alternative way of fixing this, like a small piece of code that tells Adblock it's not a real ad.

The contents of the divs are not real ads, it just holds .jpegs about the client's business.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It's better to rename your classes and id's. I would say, that image names, directories also can cause accident disappearing. Solution is to avoid words like:

  • ad
  • ads
  • adv
  • advert
  • advertisement
  • banner
  • banners

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...