P
P
Pavel2015-11-04 13:23:48
Computer networks
Pavel, 2015-11-04 13:23:48

How to hide ads on Habrhabr?

Hello everyone I
have to scroll 2 screens to see what I need in the sidebar. Markup:

<div class="block daily_best_posts SgbxvpbelN" style="display: block; padding: 0px;"><a href="" onclick="location.href='http://bit.ly/1W2ppDh';return false;" target="_blank" style="display:block;width:300px;height:500px;background-image:url('https://habrastorage.org/files/3df/b3f/0bf/3dfb3f0bf9b64ead95f878ebe56a23b3.jpg');"></a>
  </div>

SgbxvpbelN - different every time.
Installed the Stylish plugin in Chrome, wrote the style:
div[style^='display:block;width:300px;height:500px;background-image:url'] a[href='']{
    display:none !important;
    visibility: hidden !important;
}

It still shows. What am I doing wrong? Is there an addition like stylish, but to write your own JS?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel, 2015-11-04
@Pasha4ur

In general, I overcame through:

}
div.daily_best_posts[style^="display: block; padding: 0px;"]{
    display:none !important;
}
div.daily_best_posts[style^="display: block; margin-top: 0px; padding: 0px;"]{
    display:none !important;
}

Sometimes the crooked layout of developers helps users. It didn't work without !important.
Now you can't see this irrelevant and huge ad

V
Vlad Zhivotnev, 2015-11-06
@inkvizitor68sl

It is enough to install Adblock (not abp) and enable the "unobtrusive ads" filter.

N
nirvimel, 2015-11-04
@nirvimel

In principle, it is possible to create ads that are not blocked by means of CSS.
But there is no reception against scrap (userscript).
And every self-respecting programmer will write such a userscript for himself.
But sharing your creation with someone online means cutting down the tree on which we all sit.
This is not open source, the distribution of which only benefits everyone. This is not the case here.
Pasha4ur wait for Habr to bypass your solution today.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question