[英]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.