How can I center a banner?

Asked

Viewed 1,262 times

-1

I have this code below and am inserting in the wordpress plugin. The banner appears on the site but is not centered, is appearing glued to the left. Someone pde please pass me this code again just to paste inside the plugin and already appear centered the banner on the site?

<ins class="bookingaff" data-aid="1295946" data-target_aid="1295944" data-prod="banner" data-width="728" data-height="90" data-banner_id="56128" data-lang="pt-BR">
    <!-- Anything inside will go away once widget is loaded. -->
    <a href="//www.booking.com?aid=1295944">Booking.com</a>
</ins>
<script type="text/javascript">
    (function(d, sc, u) {
      var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0];
      s.type = 'text/javascript';
      s.async = true;
      s.src = u + '?v=' + (+new Date());
      p.parentNode.insertBefore(s,p);
      })(document, 'script', '//aff.bstatic.com/static/affiliate_base/js/flexiproduct.js');
</script>
  • Ever tried to use margin: 0 auto;?

  • hi, I don’t know how to change lines in this code. where do I have to put this only you said and what do I have to take in the current code? I really appreciate it!

2 answers

1

As @Rafaelaugusto said above, just add a <div> before and add margin: 0 auto; and text-align:center;, that is to say

<div style="margin:0 auto;text-align:center;">
<ins class="bookingaff" data-aid="1295946" data-target_aid="1295944" data-prod="banner" data-width="728" data-height="90" data-banner_id="56128" data-lang="pt-BR">
    <!-- Anything inside will go away once widget is loaded. -->
    <a href="//www.booking.com?aid=1295944">Booking.com</a>
</ins>
</div>
  • now it’s perfect! Thank you very much from my heart to you 2, you saved my day! I am still starting and several doubts arise, I thank you for the good will and excellent work of you, that deserve double good things!!! thank you :)))

  • @user92734 Declare the question as please accept and good code!

0

Try it out there

<div align="center">
código do banner
</div>

Or

<center>
código do banner
</center>

Exp... BANEER CRU <script data-cfasync="false" type="text/javascript" src="http://www.adexchangetracker.com/a/display.php?r=1966211"></script>

CENTRAL BANER

<center><script data-cfasync="false" type="text/javascript" src="http://www.adexchangetracker.com/a/display.php?r=1966211"></script></center>

EXP 2 RAW BANNER

<script data-cfasync="false" type="text/javascript" src="http://www.adexchangetracker.com/a/display.php?r=1966211"></script>

BANNER CENTERED

<div align="center"><script data-cfasync="false" type="text/javascript" src="http://www.adexchangetracker.com/a/display.php?r=1966211"></script></div>
  • Your code didn’t make much sense, edit the answer and explain these codes better.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.