gpt4 book ai didi

html - 在页面中水平居中 DIV

转载 作者:技术小花猫 更新时间:2023-10-29 12:47:40 24 4
gpt4 key购买 nike

我正在尝试将一个 div 居中,它是 HTML5/JavaScript 中用于 Windows 8 应用程序的 Microsoft pubCenter AdControl。

    <div id="myAd" style="; top: 0%; width: 292px; height: 60px; z-index: 1"
data-win-control="MicrosoftNSJS.Advertising.AdControl"
data-win-options="{applicationId: 'exampleAdId', adUnitId: 'exampleAdUnit'}">
</div>

我如何将 div 水平居中以使其始终位于页面中间?

最佳答案

在您的 style="" 标签中添加 margin:auto,这应该可以解决问题。

其他可能性,align=center

关于html - 在页面中水平居中 DIV,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16996775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com