Support » Fixing WordPress » Various Font-Size Styling within Individual Posts

  • Resolved rosspw


    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?


Viewing 2 replies - 1 through 2 (of 2 total)
  • 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;

    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.

    Awesome, thanks @kjodle for the quick workaround.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Various Font-Size Styling within Individual Posts’ is closed to new replies.