Changing fonts within a page?

  • Unknown's avatar

    Wondering if it’s possible to change fonts within one post. I have the custom program and have a choice of fonts but it’s a blanket thing….

    It would be nice to be able to add a little variety from time to time. Is it even possible?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Each post has a unique ID number which you can find by inspecting the HTML and looking at the classes assigned to the body tag on the single post view. You can then use a rule like the one below to change the font for a particular post:

    .post-11786 .entry-content {
      font-family:courier;
    }

    It won’t have any effect on bits of your post that have had inline CSS rules applied to them though.

  • Unknown's avatar

    But you cannot change the font from one topic or one paragraph to another?

  • Unknown's avatar

    You would have to do that in the post text editor using inline CSS or by assigning classes, like so:

    <p style="color:#f00;">This is red</p>

    You could use any HTML element you like but if you just want one paragraph then p is the one to use. If you want multiple paragraphs/lists/etc. then wrap them all in a div element and apply the styles to the div instead.

    The other option is to set the styles in your custom CSS but apply classes in the text editor – this will make it easier to modify across multiple posts/pages if you ever want to make changes – you can change one custom CSS declaration and it will apply to every element with the given class. In the text editor you’d have something like:

    <p class="customstyle01">This will depend on your custom CSS.</p>

    And then in your custom CSS:

    .customstyle01 {
      color:#0f0;
      font-family:verdana;
      padding-left:20px;
    }
  • Unknown's avatar

    Thanks very much…I will experiment using your suggestions.

  • The topic ‘Changing fonts within a page?’ is closed to new replies.