WordPress.org

Ready to get started?Download WordPress

Forums

Change font size of ads through theme's css (5 posts)

  1. markaz18
    Member
    Posted 3 years ago #

    Hi.

    I've been told my theme is limiting the font size of google ads displayed on the site. I've selected 'large' from the Adsense menu, but the ads appear pretty tiny on my site. The Adsense forum indicated my CSS has limited the size to 11px (my main text font size is 14px). How can I edit this value (i.e. from 11px to 14px)?

    My theme is Clear Line, and my site is: http://microfinancehub.com/

    Thanks, in advance.

  2. Connor Montgomery
    Member
    Posted 3 years ago #

    Hey markaz18,

    To change it, you'll have to override the default styles in your own CSS file. To do so, do the following:
    .adb, .adt{font-size:14px !important;}

    note: the !important just before the ; - that makes it override other declarations.

    You'll most likely also want to change the line-height and misc. other properties of the google ad to make it look better. I would recommend installing firebug, as this would be a great exercise to get acquainted with it.

    Hope that helps! If you give it a shot and have no luck, post back here and I'll help you out!

    Best,
    Connor
    [Signature removed by moderator per forum rules.]

  3. @mercime
    Volunteer Moderator
    Posted 3 years ago #

    Actually, the style 11px came from Adsense:

    .adb {
    font-size:11px;
    display:block;
    color:#000000;
    }

    so one way to override that would be to add this in your active theme's style.css

    .adb {
    font-size:14px !important;
    }

    change 14px to what you want, the !important will make sure you've got the font-size you want even if the added adsense style comes after your theme's stylesheet.

  4. markaz18
    Member
    Posted 3 years ago #

    Connor and mercime,

    Thanks for replying. I'm afraid I need a little more guidance. My style.css file doesn't seem to have the code you mentioned (.adb) Should I ad the script myself? If so, where do I position it in the stylesheet? I'm using a plugin to manage Adsense (Advertisement Management).

    I also understand it's forbidden to tweak the adsense code - is it legal to tweak it through WP instead? I've seen plenty of famous/popular websites with large ad fonts (http://www.digital-photography-school.com/).

  5. markaz18
    Member
    Posted 3 years ago #

    I just tried adding:

    .adb {
    font-size:14px !important;
    display:block;
    color:#000000;
    }

    at the end of the stylesheet. It doesn't work this way, I guess. What else can I try?

Topic Closed

This topic has been closed to new replies.

About this Topic