Iframe width in sidebar being modified?

This problem has only begun recently. When placing an iframe into a text widget in the sidebar, it overwrites the width value in the style attribute. It’s really odd… This also only happens in the sidebar. Here’s an example page: http://www.theccsn.com/testing/ (password is thisisatestpage)

The code for the iframe is identical in the page content AND in the sidebar widget. Here is the exact code:

<div align="center"><iframe style="width: 120px; height: 240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=chrisandcom02-20&marketplace=amazon&region=US&placement=083082815X&asins=083082815X&linkId=NIUTXE433U6H6H7K&show_border=true&link_opens_in_new_window=true">

Please note the “width: 120px” portion. If you go to the page I linked, the iframe in the sidebar has had this changed to “width: 100%”. See this screenshot to show, definitively, the width is being modified: https://d.pr/i/s9EtMm

Also, again, please note, this ONLY applies to the sidebar. On the example page, the exact same code is placed into the page content and it is not changed.

Hello @rwoods12,

Thanks for asking. :slight_smile:

I tried adding the iframe code in sidebar you have shared on my local X Theme setup and I don’t see width value getting converted to 100%. https://cloudup.com/cFTFtpKvF2W

However, I noticed that the code you have shared is having proper closing tags. Please update the code with following:


<div align="center"><iframe style="width: 120px; height: 240px;" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=chrisandcom02-20&marketplace=amazon&region=US&placement=083082815X&asins=083082815X&linkId=NIUTXE433U6H6H7K&show_border=true&link_opens_in_new_window=true"></iframe></div>

You can also add following CSS under X > Theme Options > CSS to fix the sidebar iframe width issue:

.x-sidebar iframe {
    width: 120px !important;
}

Thanks.

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