WordPress.org

Ready to get started?Download WordPress

Forums

CSS Driving me Batty :( (10 posts)

  1. samzuni
    Member
    Posted 9 years ago #

    I have been racking my brain on the wp-layout.css file and the index.php file to attempt to change the font family of The Loop's 'storycontent' to be more readable and have not been able to find the magic key. I've changes lots of other thing but for some reason this eludes me, being a noobie and all. :(
    I'm sure it's something dirt simple that I have overlooked...

  2. midori
    Member
    Posted 9 years ago #

    .storycontent { font: fontname; } or .storycontent { font-family: fontfamily; } ? With !important to overule other settings ?
    http://www.w3schools.com/css/css_reference.asp

  3. samzuni
    Member
    Posted 9 years ago #

    Darn, that didn't work.
    Was hoping adding the !important declaration would do the trick, but no dice. This is what I currently have with the !important added:
    .storycontent {
    font-family: Times, sans-serif, serif;
    font: Times, sans-serif, serif;
    !important;
    }
    I even tried both at the same time as above but same result. Also tried changes in the .body but no dice there either. Somewhere I am missing how this is nested, I guess.
    BTW, talk about fast response. The first post had been read 4 times and my finger was barely off the Post button. Whew!

  4. samzuni
    Member
    Posted 9 years ago #

    Thanks midori and podz. I never use the 'p' correctly by rarely closing it, so tend to forget. That made all the difference, and I left it right below the two .storytitles so as to keep them grouped together.
    I love this forum...

  5. samzuni
    Member
    Posted 9 years ago #

    Here is the end result. I spaced the letters a bit also to make it a bit more readable:
    .storycontent p {
    font-family: Times, sans-serif, serif;
    font: Times, sans-serif, serif;
    font-size: 12pt;
    letter-spacing: 0.001em;
    }
    Don't think both lines for the font are necessary, but I just left them there as they aren't hurting anything.

  6. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Just a thought- if you ever use a list in a post, it probably will not be displayed the same, and you might want to do a test post with them, and blockquote while you are playing with the css.

  7. samzuni
    Member
    Posted 9 years ago #

    Good Idea! Actually, I haven't used many of the markup code during posts. Will give me something to do :) I'm having a ball with this, and enjoying the challenge. Thanks!

  8. moshu
    Member
    Posted 9 years ago #

    @samzuni,
    the wise internet gurus say that you should have for fonts a few types (e.g. {Times, Georgia, "New Times Roman"}) in the order you would like them to be chosen, in case the first doesn't exist on the visitor's machine; then a more generic family, like "serif" for this group.
    So, on the other hand, if you have a list of font types like {verdana, helvetica, arial} you would add as the generic type for them "sans-serif".
    What I mean: the Times, sans-serif, serif; doesn't really make sense for me - you either want serif fonts or sans-serif.

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    Alternatively, you can put the class attribute directly in the tag:
    <p class="storycontent">
    This way you can assign the class to any text element. The extra 'p' in the CSS reference would only apply to paragraph elements within the enclosing storycontent element

  10. Root
    Member
    Posted 9 years ago #

    Just on the fonts; once you are fixed on serif or sans serif the gurus also try and offer one font for each OS in turn which is similar and likely to be available on Macs / Windows / Linux.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.