Is there a way to make only the first sentence in the final paragraph bold using CSS? Specifically, I would like to add extra padding to the top of this last paragraph so that it wraps around an image. However, when I increase the bottom padding of the floated image, the paragraph doesn't align with the left margin of the image as desired. I attempted to apply a class to the "p" element for targeting a specific paragraph, but I couldn't find a ":last-child" pseudo-element and I'm unsure if multiple pseudo-elements can be used on one element or class.
#wf_mainContent_left p.last_wfp:first-line {
padding-top: 20px;
font-weight: bold;
color: red;
}
HTML
<p class="last_wfp">This is the first sentence that should be bold and red. This is the second
sentence without those styles.</p>
Although according to this tutorial, the CSS provided bolds both sentences instead of just the first one since they are on the same line. Padding adjustments also had no effect. I tried adding a <br>
tag but it introduced too much space. The styling of the <br>
tag isn't possible based on information from this post. Ultimately, my goal is to have only the first line in bold without affecting the entire paragraph.