如何在Windows 8 App中居中对齐广告

时间:2013-11-10 08:47:39

标签: css windows-8 windows-8.1

以下是我在Windows 8 / 8.1 app中对齐广告的代码

<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>

但是我无法成功调整。让我们看看你能做些什么。

由于

1 个答案:

答案 0 :(得分:0)

要水平居中div,请使用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>