I have a Google AdSense element on my WordPress but as default it is left aligned. How can I make it center align on the horisontal axis?
The code I have tried is:
<div style="margin:auto">
//AdSende Script
</div>
I have a Google AdSense element on my WordPress but as default it is left aligned. How can I make it center align on the horisontal axis?
The code I have tried is:
<div style="margin:auto">
//AdSende Script
</div>
You must be logged in to post a comment.
Add adsense code under center tag..or in table
or
add table
What if you try something like the following:
And in your CSS:
If you’re using Internet Explorer make sure your DOCTYPE is set correctly or it’ll enter quirksmode and break
margin:auto
functionality.try this simple code :
This is what works for me. Tested!
Margin auto is fine but it needs a width to work. So:
Note: adjust width as necessary.
I successfully center adsense ads like this.