Target and remove extra space caused by disabeling adsense ad on specific view

Posted in: Newspaper
Post count: 137

I have an adsense ad that is displayed only on mobile view, works great.

Problem is that when in regular view the ad-space leaves an empty row behind that kind of breaks the design of the page. The problem is illustrated in the picture below.

I´m using the Custom Ad – option to add the adsense ad to the page.

The header-ad is set to dissapear on mobile view, and this works perfect and leaves no white space behind when it is disabled (try shrinking the browser window and refresh the browser).

So, how can I get rid of the white space when the Custom Ad is disabled on computer/desktop view?

Site is: enkelteknik.se

  • This topic was modified 11 years by MrOrsh.
Post count: 7909

Hi,

There is a margin bottom for all custom ads – http://screencast.com/t/yLYbA8Bj4 and unfortunately there is no specific class to target the ad when it is hidden. A solution is to remove this margin using media queries, try this custom css in Theme Panel > Custom Css to remove it for other devices than mobile – http://screencast.com/t/VsJTHrPH9Q

@media (min-width: 768px) {
.td-g-rec-id-custom_ad_2 {
margin-bottom: 0 !important;
}
}

Hope this helps!

Post count: 137

Brilliant! Exactly what I was looking for. Thank you 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.