Send by LINE
B! Bookmarks in Hate-bu
Bookmarks in Pocket
RSS feeds

Google AdSense: How to fix ads sticking out

Other language site
No available translations found
Google Translate
network image

Suddenly, the advertisement size of Google Adsense widely spread to the page width size.

Until then, I specified the size with css, but suddenly css ceased to work. That's how to deal with it.

One day suddenly css ceases to work, advertising spreads across the page width

As of the end of November 2017, one day suddenly Google Adsense advertisement of my blog site began to spread to the full page width.

I inserted an advertisement of Google Adsense in the related article display of a blog arranged in a tile format.
That advertisement suddenly became huge display.

Since it was an event in the part arranged in the tile form, the page was displayed so as to be greatly collapsed.
Urgent response was necessary.

The reason was that the size specification of css was overwritten with the html style attribute or the one specified in JavaScript.
It will not be fixed even if you try to respond with css.

I decided to try out a certain method there.

Specify size directly in Google Adsense code

Therefore, we corrected specifying the size directly with the style of Google Adsense code.
The correction contents are as follows.

<script async src="//"></script>
<ins class="adsbygoogle gads"
    style="display:block; width:258px; max-height:258px;"
    (adsbygoogle = window.adsbygoogle || []).push({});

I specified the size with the style attribute of the ins tag. This was fixed.

This is only a tentative measure

This is a provisional measure to the last.

This method can not deal with what displays responsive advertisements.
In the case of me, tile format advertisement is the same method as smartphone and PC because the size is same.

This is a mysterious place, but in my case, it was not displayed huge in the responsive display place on the same page.
Maybe because Google has made some corrections.

For the time being I will see how it is going.

Leave a Reply