Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS How can I style the top area of my category pages where it’s readable?

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #27409
    ricksmith
    Participant

    At the top of my category pages I can write a description of that category, however it’s not really readable right not.

    Here is a link to see what I’m talking about http://noahsdad.com/therapy/

    Any thoughts on how to make it readable, (and feel free to leave any style tips to make it look good if you’d like!) Thanks! :)

    #110246
    chrisburton
    Participant

    The most simplest way is to change the text color.

    #110253
    Kitty Giraudel
    Participant

    Change text color or add a background color. :)

    #110287
    ricksmith
    Participant

    The problem is, if I change the text color, it changes the text color of the blog post as well. I just want that text to be changed.

    #110291
    Kitty Giraudel
    Participant

    Add a class to it ?

    If you don’t want / can’t, go with the :first-of-type pseudo-selector. :)

    #110294
    ricksmith
    Participant

    Hey Hugo I’m not really sure how to do that. (I’m just now learning my way around wordpress and CSS) would you mind helping me figure out how to do that?

    Thanks!

    #110295
    Kitty Giraudel
    Participant

    The first way is basic HTML / CSS. You add a class to the description in order to give it different styles. Something like :

    .my-description {
    color: white;
    }

    The second way is not totally cross-browser, since not every browser supports pseudo-selectors. So if you want this to work back on something like IE6, you'd better go with the first way.
    But if you don't mind about legacy browsers, then you could try this :

    .my-article p:first-of-type {
    color: white;
    }

    Basically it tells to the first <p> tag in the element .my-article to be white.

    Edit: I just dug a little bit on your code, and you can do it very easily without changing anything.

    #archive-page-title p {
    color: white;
    }

    Your #archive-page-title div has only one <p> tag in it: the description. You can style it without a problem.

    #110320
    ricksmith
    Participant

    Thanks. That worked like a charm! :)

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.