samedi 25 juillet 2015

How can I apply a style to a span of text that transcends other elements' boundaries?

Let's suppose I have the following paragraphs:

<p>one two </p> <p> three </p><p> four five </p>

Now let's suppose I want to style the words two, three, and four green, in place, without having any other effect on the document's structure or other layout. I basically want a <span> that transcends block level elements like <p>s. How can I accomplish this most simply? I could

<p>o <span>t</span></p><p><span>t</span></p><p><span>f</span> f</p>

But that makes things really messy due to the fact that I employ a markdown parser and have my own custom preprocessing code. What could I do so that there's only one "style begin" mark, and only one "style end" mark per contiguous length of green text?




Aucun commentaire:

Enregistrer un commentaire