WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Various Font-Size Styling within Individual Posts (3 posts)

  1. rosspw
    Member
    Posted 2 years ago #

    I have a pretty basic question I could not seem to find a clear answer to.

    I have a blog setup, and I would like to find a way to ahve the first paragraph of a blog post have different font styling than the rest of the blog post body.

    Something like:

    .post-body {font-size: 14px; font-weight: normal;}
    .first-paragraph {font-size: 24px; font-weight: bold;}

    Is there any easy way or hack to just identify and isolate the first paragraph of each post, and style it accordingly?

    Thanks!!

  2. kjodle
    Member
    Posted 2 years ago #

    It depends on how your theme sets up each blog post, but this works for me:

    .entry-content p:first-of-type {
    	line-height: 18px;
    	text-align: justify;
    	letter-spacing:0.5px;
    	word-spacing:1px;
    }

    Add that to your theme's custom CSS option (if it has one) or add it to your child theme's stylesheet.

    Replace .entry-content with whatever code your theme uses to indicate post content.

  3. rosspw
    Member
    Posted 2 years ago #

    Awesome, thanks @kjodle for the quick workaround.

Topic Closed

This topic has been closed to new replies.

About this Topic