WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Not able to change font-size (11 posts)

  1. makta112
    Member
    Posted 2 years ago #

    Hello

    I'm trying to change the size of the links in the sidebar of my site under 'POPULAR STORIES'.

    But I'm unable to do so. It should work with this code but it doesn't:

    .popular-posts a {
        font-size: 13px !important;
    }
  2. Valerie
    Member
    Posted 2 years ago #

    Each popular link you have also encloses its text in a span element, like this:
    <a><span class="wpp-post-title">link text here</span></a>

    The class wpp-post-title has 3 css styles: font-size, font-weight, line-height, which are applied after the <a> style which you're trying to change.

    So, you can remove the span element from the links or remove the styles from the wpp-post-title class or style the wpp-post-title instead of the <a> element.

  3. makta112
    Member
    Posted 2 years ago #

    Hi, thanks. That's what I was looking for.

    Also, can you help me remove the line-height?

    I've tried adding line-height:normal and line-height:1em

    But it doesn't go away.

  4. Valerie
    Member
    Posted 2 years ago #

    Line height isn't something that you can really make go away, it's similar to font-size in that way. Text has to have a font-size and, in a similar way, it has a line-height.

    So, in this situation, you should choose a line-height that makes sense (i.e. looks good). Try putting in different values to see what works for you.
    Here's some info you might find useful: http://www.w3schools.com/cssref/pr_dim_line-height.asp

  5. makta112
    Member
    Posted 2 years ago #

    I can't use negative value?

  6. Valerie
    Member
    Posted 2 years ago #

    Oh yes, you can :)

  7. makta112
    Member
    Posted 2 years ago #

    I'm trying but it's not working??

  8. Valerie
    Member
    Posted 2 years ago #

    When I try changing the line-height of the class wpp-post-title to
    line-height:3em;
    or
    line-height:-2em;
    both work for me.

    (I'm using firebug, by the way, to make those changes on the fly and see them work.)

  9. makta112
    Member
    Posted 2 years ago #

    It doesn't work when I add -2em?? And I'm using Firebug too.

  10. Valerie
    Member
    Posted 2 years ago #

    Does it not work when you try to change the css files or when you're using Firebug?

  11. makta112
    Member
    Posted 2 years ago #

    I had to remove body {line-height:1.5} :o

    Everything is fine now.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic