Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Can't Centre Amazon Affiliate Banner in Sidebar Widget (WordPress)

I have decided to add a cool niche-related product to my post pages on the off chance and it doesn't sit right on my page.

Here's an example: http://tarantulair.com/handling-tarantulas/

As you can see, the image sits to the left. I have tried centring with <centre></centre> and adding a value to the margin but to no avail. Here's the code:

Code
<iframe style="width:120px;height:240px;" marginwidth="20px" marginheight="20pc" scrolling="no" frameborder="0" src="//ws-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=GB&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=tarantulair-21&marketplace=amazon&region=GB&placement=B01LAUHC1I&asins=B01LAUHC1I&linkId=a945343dae439f58844a44792150f07c&show_border=true&link_opens_in_new_window=true&price_color=29d91c&title_color=0066c0&bg_color=ffffff">
    </iframe>

Any help would be greatly appreciated.
Resident Writer for MyGamer.Com and Horrify.Net
For the parent of that iFrame, add "text-align: center" to the css. Or just paste this into your CSS:
Code
.textwidget.custom-html-widget {
text-align: center;
}
Before: https://prnt.sc/iusxzc
After: https://prnt.sc/iuszeb

Also, <center> tag is no longer supported in HTML5. Don't use it.

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.
(Mar 22, 2018 06:07 AM)Nachfolger Wrote:  For the parent of that iFrame, add "text-align: center" to the css. Or just paste this into your CSS:
Code
.textwidget.custom-html-widget {
text-align: center;
}
Before:  https://prnt.sc/iusxzc
After: https://prnt.sc/iuszeb

Also, <center> tag is no longer supported in HTML5. Don't use it.

I hate WP for this reason. Editing stuff like this can be a nightmare. I'll go see if I can find the appropriate file. Thanks, man!
Resident Writer for MyGamer.Com and Horrify.Net
(Mar 22, 2018 06:20 AM)Effexion Wrote:   I hate WP for this reason. Editing stuff like this can be a nightmare. I'll go see if I can find the appropriate file. Thanks, man!
Likewise. If you inspect element and look at the css portion, it will tell you which file it's stored it. Gl bro. The site looks nice, too bad I'm not a fan of spoders.

Je t'aime
[Image: fpZ5a5g.png]

(Apr 22, 2022 04:39 PM)-Scrub Wrote:  Jokes on you, I'm not smart enough to know what he's talking about.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by routesetterAug 12, 2025 08:23 AM 0 126 Aug 12, 2025 08:23 AM
Last Post: routesetter
[Wordpress] by TheGeek1Mar 1, 2019 06:49 PM 5 283 Mar 1, 2019 06:49 PM
Last Post: TheGeek1
by Yoko_Nov 2, 2018 06:42 AM 5 329 Nov 2, 2018 06:42 AM
Last Post: wehemod