The effect I'm looking for in the end is to have the first line in some paragraphs bolded. These would be the first paragraph of each section in my post. This kind of effect is used on this Bloomberg.com post. Notice the first paragraph in the post and then also the first paragraph of later sections of the post are bolded. The way they accomplished this was to have a particular class ("section-break" in their post) applied to the paragraphs they wanted this effect on, and then using the ::first-line css pseudo class, applying it to the paragraphs with the "section-break" class.

I can set up the css to do that what they did; the only thing I'm struggling with his how I can delineate, while writing my post, which paragraphs would be the beginning of a new section and so would need to have their own "section-break" class. Is there a built in way to do this? And if not how might I be able to hack it in?


  • Can't you do it manually - in HTML view of the editor? <p class="whatever">your paragraph</p> – montrealist Apr 1 '16 at 2:30
  • 1
    Yup, just figured that out. I thought since paragraph tags were created automatically it wouldn't let you, but it does. Thanks! – fivestones Apr 1 '16 at 2:34

I figured this out. Even though Wordpress automatically adds the <p> tag and doesn't show it to you in the editor (in either the 'visual' or 'text' editor views), you can type it in anyway in the 'text' editor view, along with a class.

So to do this, go to the 'text' editor view, and just type, e.g., <p class="section-break>Here is the first paragraph of a new section of my document</p>.

And although when you type a regular <p> tag yourself (without a class) it will disappear when you switch to the 'visual' editor and back to the 'text' editor view, if instead you type it in with a class, it will stay there available to edit if it has a class attribute (e.g., <p class="something">stuff</p>).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.