Struggling a little to centrally align a leaderboard ad on Dots & Dashes – positions itself correctly on certain pages, and incorrectly on several others, by the seems of it.
Have applied the <div class="center">AD CODE</div>
tag, although that doesn't seem to have done the trick...
Any advice would be greatly appreciated, as per always!
Thanks.
Do you mean center horizontally or vertically?
To center horizontally you can add the following to the top of the page (within the <head></head>
section):
<style type="text/css">
.center {
text-align:center;
}
</style>
The above will control the class that you assigned (center) and adds text-align:center; to it.
If you are looking to center the div vertically, please post a JSFiddle
To center something horizontally within the DIV use the following code...
<style type="text/css">
.center {
text-align:center;
}
</style>
But to center something horizontally within the WINDOW and DIV, try this....
<style type="text/css">
.center {
text-align: center;
margin: 0 auto;
}
</style>