h2 font changes

  • Author
  • #1194789

    Hi all,

    I’m a newbie to CSS, as you’ll be able to tell from my question. I’m trying to modify my post header font size and colour, so I’ve copied code directly from the tutorial examples. Modifying the background color & margins, padding, etc. work, but the only two things I want to change are the color (to make it black) and size (to make it smaller). But playing around with these parameters doesn’t seem to have any effect. Can you please explain why or what I’m doing wrong?

    My site is crunchcompass.com and the sample code I’m trying is:
    h2 {
    color: #ffc;
    font-size: 1em;

    Thanks very much!

    The blog I need help with is crunchcompass.com.


    In the theme you are using, as in most WordPress themes, the post/page titles are set with more specific selectors in the CSS. In your theme, you would need to do the following. I’ve changed the color to black, and you can adjust the font size as you desire.

    .hentry h1, .list-post-item h2 a {
    color: #000000;
    font-size: 22px;

    There are two selectors – .hentry h1 and .list-post-item h2 a – that I’ve used. These don’t show up in the CSS. I created these from looking at the markup (html page source) and the current CSS so that I could specifically target the post titles for you and not affect any other h1 or h2 elements in the theme. The post titles on the main blog page are links (and an h2), and the second selector takes care of that. The title on the single post page is not a link (and h1), and the first selector takes care of it.


    Thank you so much – that is exactly what I was hoping for!


    You are welcome.

The topic ‘h2 font changes’ is closed to new replies.