Need help with remove a CSS property

Hello there,

I have an issue with ad alignment, due to the iframe CSS.

Our ads are served by Ad Asia Holdings- a Google certified publishing partner, they found a CSS issue, which causes the ad to align left. Here are the examples:

As you can see ad appears towards left. And “width=100%”

Now when I delete “width: 100%” then it appears perfectly. Here is example:

I tried different property to override the CSS, but sadly nothing is working.

Here is the property we use:

Sadly nothing is happened, except removing “width: 100%”

So can you help me to remove this CSS property? or Anything you can suggest to me.

REF URL: https://learnmechanical.com/hydraulic-clutch/

P.S.: As we header bidding, you might not find the similar ad units when you visit the above URL, however, except 728px ads, all other units having same problem.

Hi @learnmechanical2019

Although we don’t offer any support to the issues which come due to any third-party code,
I would suggest you to add the code in a section with a specific ID and use the following code:

 .entry-content #<ID> iframe{
    width: 100%;
    max-width: 100%;
}

Remember that the suggestion in the above-mentioned thread will work if copied as it is and doesn’t conflict with any existing code.
Please note that the code provided serves only as a guide to help you get started custom coding on your own if there’s no option offered in our theme or the products we bundle.
We do not provide support for custom codes that means we can’t fix it in case it conflicts with something in your site nor will we enhance it.

Hope it helps.

Hello @tristup

Thanks for the quick action but sadly still it is not working,

width: 100%; max-width: 100%;

I need to remove this “width: 100%” property, which causing the issue, can you tell me where I can find this css, and remove this one only from root?

Hi Again,

I just remove the CSS from the core, now it is working great, so if I replace the CSS in the child theme in a same path, is it replace in the front end?

Hi Saswata,

No, it would not, and I’m afraid removing a styling from the core would cause you more trouble than good. In CSS you don’t need to remove a styling, you just need to overwrite it, since you already know the selector (.entry-content iframe) use that to adjust the width of your ad.

Thanks,

Hello, @friech

Umm, I do have an option to fix the width. But sadly I can’t as, we are using dynamic bidding on different sizes, which advertisers want, like, some widths are 728, 450, 250 etc. etc. at the same slot. So it is quite tough for fixed any particular width. :frowning:

Hi Saswata,

Then your best option is to keep the width: 100% to make sure your ads won’t be cut off and will give you the right size of banner.

The ads will choose the best fit for the user screen-size, like on my end I do get all the ads as 728 banner on desktop and the 450 on mobile. These ads have their own way of being responsive. You can only style the iframe but not what is inside of it.

Thanks,

1 Like

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