• p:first-letter
    {
    color:#ff0000;
    font-size:xx-large;
    }

    I added the code above, but it affected every first letter of all paragraphs. Please help me out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try inquiring on a CSS-specific forum, as CSS queries this specific expand beyond WordPress’ scope for support.

    Good Guy

    (@mytaxsitecouk)

    Your css should look something like this:

    p.special:first-line {
    	text-transform: uppercase;
    }
    
    p.special:first-letter {
    	font-size: 20pt;
    	color: red;
    }

    and your HTML would look like this:

    <p class="special">Test of my fonts;</p>

    Now only the selected paragraph will be affected by this code.

    Good luck.

    Thread Starter RakeshRahman

    (@rakeshrahman)

    You meant I have to change the HTML as well?

    Thanks for your reply

    Good Guy

    (@mytaxsitecouk)

    You meant I have to change the HTML as well?

    Yes to target specific paragraphs otherwise the generic one will change all of the p tags.

    Also, use these codes in a child theme so that you don’t have to worry about automatic updates of themes in the future.

    Good luck.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to amke the first letter of a post bigger with different color?’ is closed to new replies.