0

这是我在 Windows 8/8.1 应用程序中居中对齐广告的代码

<div id="myAd" style="position: absolute; bottom: 0px; left: auto; width: 728px; height: 90px; z-index: 1"
     data-win-control="MicrosoftNSJS.Advertising.AdControl"
     data-win-options="{applicationId: 'd25517cb-12d4-4699-8bdc-52040c712cab', adUnitId: '10043105'}">
</div>

但是我无法成功对齐。让我们看看你能做什么。

谢谢

4

1 回答 1

0

要使 adiv水平居中,请使用margin: 0 auto.

<div id="myAd" style="position: absolute; bottom: 0px; margin: 0 auto; width: 728px; height: 90px; z-index: 1"
     data-win-control="MicrosoftNSJS.Advertising.AdControl"
     data-win-options="{applicationId: 'd25517cb-12d4-4699-8bdc-52040c712cab', adUnitId: '10043105'}">
</div>
于 2013-11-10T20:49:14.850 回答