Need Help with Ad Alignment

Our ads are provided and optimized by Google certified publisher partner. So now the problem occurred that is:

This is the by default ad placement, as you can see the image and text is aligned left [However it is not for all ads appeared in this position, that mean whenever In article ads(Text + Image) appears the left-aligned problem occurred. They are tried using CSS but they are saying us to delete [WIDTH: 100%] CSS. Like this.

So as you can see when the CSS [Width: 100%] omitted, ad is looking perfect.
However, this problem is with Image + Text ads. Display ads are perfect, no issue with this CSS. So can you guys help me to delete that Particular CSS style [Width: 100%]?

Thanks much again!

Site: Learnmechanical.com

I very much doubt if you can figure out the ads or not on the site, as in your country probably display ads are showing rather than text+image ads.
Still, it will be great if you can help me out.

I tried using: Auto, fit-content, inherit, initial, max-content, min-content, none, unset, web fill, but nothing happens or sometimes the ad is cropped, so there is only option to delete that particular CSS.

Hello Saswata,

Thanks for posting in! Deleting the mentioned CSS block is not possible because it would mean to reconstruct the whole style.css file in the theme. What you need to do is to override the CSS instead. You can make use this code to make it work over your Google Ads.

.entry-content .x-text embed, 
.entry-content .x-text iframe, 
.entry-content .x-text object {
    width: auto;
    max-width: 100%;
}

To learn more about the CSS width property, please check this out:

Feel free to make adjustment to the code above as you need. Here are some related links for further reading, this could help you in finding and implementing some CSS fixes:

Hello @ruenel thanks for your detailed reply, but as I already said, I used the CSS property “Auto”, so in this case what happened in the ads are cropped when I use auto.

And for 728*90 sizes it crops down to 300 pixels. :frowning:

It should be like this:

As you can see, while removing this CSS [Width: Auto or Width: 100%] then it is perfect, so is there any other ways?

Hi Saswata,

In that case, you can use the above CSS but change width: auto to width: unset.

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.