I'm trying to center a div, which is the Microsoft pubCenter AdControl for Windows 8 apps in HTML5/JavaScript.
<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>
How would I center a div horizontally so it is always in the middle of a page?
Add margin:auto
in your style=""
tag and that should do the trick.
Other possibility, align=center