tags:

views:

32

answers:

1

Hello,

Is it possible so style a paragraph line by line with CSS? Say first line will have the green color, second line the red, and the third line the yellow. Note that the paragraph is native and no other tag is used inside the paragraph. I just want to change the style with CSS if possible.

Thanks.

+4  A: 

There is a :first-line pseudo-element in CSS that lets you style the first line of the paragraph differently from the other lines, so you could color the first line green. But I don't know of a way to specify the second line as distinct from the third line, unless you add some type of delimiter element such as span.

JacobM
Thanks but I need only CSS way. No HTML change in other words.
Valentina Tatya
I understand; the summary of my answer was meant to be "there isn't one".
JacobM