Q&A
Mr. Pickles the AdPlugg Pug

How do I center my ads?

+1
1
-1

I want to center the ads within my sidebar. How do I do that?



Answers

+1
1
-1

To center your ads, you can use the following CSS:

.adplugg-tag img {
    margin: 0 auto 1em auto;
}

If you aren't familiar with css, this says to put a 1 character bottom margin and automatically calculate an even (centered) left and right margin on each of your ads.  You can change the 1em to 2em for more space or 0.5em etc. for less.

For it to work, you add the above CSS to your site's stylesheet. If you are using WordPress, you can do the following to modify your stylesheet:

  1. Log in to your WordPress administrator.
  2. Go to Appearance, then Customize, then Additional CSS.
  3. Add the CSS code from above.
  4. Press the Save & Publish button at the top of the screen.

EDIT 2015-12-02: We have also had success with certain themes using this css:

.adplugg-ad {
    display: table;
    margin: 0 auto 1em auto;
}

EDIT 2016-03-24: We have also had success with certain themes using this very simple css:

.adplugg-tag { 
    text-align: center;
}

 

Hi there. I have dropped this code in, and the ad has still not centered in the column? Is there something else I can try?
The styling of your site is largely dependent on your existing CSS or theme. You could try putting "!important" at the end of the line so that it reads "margin: 0 auto 1em auto !important;". If that doesn't work, please use our contact form and send us a link to your site and we can take a look.