简体   繁体   English

无法找到如何使广告居中。 我试过align =“ center”和margin:auto但没有用。

[英]Can't find how to center my ads. I have tried align=“center” and margin:auto but nothing works.

<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. 我尝试过align =“ center”的样式和margin:auto,但是不起作用。

Try: 尝试:

margin: 0 auto;

0 for the top/bottom and auto for left/right 顶部/底部为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;">

Wrap it: 包装:

<div style="width:100%; text-align:center">
your code goes here
</div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 text-align:center 居中导航栏元素; 也没有边距:0自动; - Can't center nav bar elements with text-align:center; nor margin: 0 auto; 如何在我的代码中居中亚马逊原生购物广告? - How can i center amazon native shopping ads in my code? 为什么我不能居中对齐 <td> 文本? - Why can't I center align my <td> text? `Phaser.Display.Align.In.Center` 适用于我的文本的第一行,但不能使我的第二行居中。 我如何解决它? - `Phaser.Display.Align.In.Center` works well with the first line of my text but doesn't center my 2nd line. How do I fix it? 使用display:table和margin:auto时图标对齐中心,但是当我更改为display:none时,.show()之后图标不对齐中心 - Icon aligns to center when using display: table and margin: auto, but when I change to display:none it does not align to center after .show() text-align:center和margin:0自动不适用于绝对定位的元素 - Text-align:center and margin:0 auto not working on absolute positioned elements 我的价值不会使文本居中对齐 - My Value won't text align center 如何在JS中找到画布的中心 - How can I find the center of a canvas in js 无法将超大图像与div中心对齐 - Can't align oversized image to center of div 如何使文本居中并保持对齐? - How can I center a text and keep being left align?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM