0
<div id="537267839_INSERT_SLOT_ID_HERE" 
style="width:768px;height:90px;margin:auto;">

 <noscript>
  <p align="center">
    <iframe id="a1651026db" name="a1651026db" src="//oncampusweb-d.openx.net/w/1.0/afr?auid=537267839&cb=INSERT_RANDOM_NUMBER_HERE"frameborder="0" scrolling="no" width="728" height="90" align="center"display:block;>
 <a href="//oncampusweb-d.openx.net/w/1.0/rc?cs=a1651026db&cb=INSERT_RANDOM_NUMBER_HERE" ><img src="//oncampusweb-d.openx.net/w/1.0/ai?auid=537267839&cs=a1651026db&cb=INSERT_RANDOM_NUMBER_HERE" border="0" alt=""></a>
 </p>
 </iframe></noscript>
</div>

<script type="text/javascript"> 
 var OX_ads = OX_ads || [];
    OX_ads.push({
    slot_id: "537267839_INSERT_SLOT_ID_HERE",
    auid: "537267839"
});
</script>




   <script type="text/javascript" src="//oncampusweb-d.openx.net/w/1.0/jstag"> 
 </script>

In this code I want to center the ad being placed. I can't figure out how. I tried align="center" in style and margin:auto but it doesnt work.

3 Answers3

0

Try:

margin: 0 auto;

0 for the top/bottom and auto for left/right

Wolgan Ens
  • 385
  • 1
  • 11
0

Try using a flex box to center align child components both vertically and horizontally.

<div id="537267839_INSERT_SLOT_ID_HERE" 
style="width:768px;height:90px;display:flex;justify 
content:center;align-items:center;">
Shubham Gupta
  • 2,596
  • 1
  • 8
  • 19
0

Wrap it:

<div style="width:100%; text-align:center">
your code goes here
</div>
Void Spirit
  • 879
  • 6
  • 18
  • Did not fix it. Thanks though! –  Sep 27 '18 at 17:34
  • Ok new problem. That looks great, exactly what I want. Any idea why it wont show up when pasted into wordpress? –  Sep 27 '18 at 17:44
  • I think you have another wrapper element that is giving another style. I think you have to share your code. – Void Spirit Sep 27 '18 at 17:50