I'm developing a website and would like to alter the formatting of <p> tags based on their position in a document. For instance, a <p> tag following another <p></p> tag should have one formatting, but a <p> following an <h?></h?> should have a different formatting.
I know how to do this using classes, (e.g. "<p class='format1'>" or "<p class='format2'>") but I'd like something more automated so that authors can freely re-arrange paragraphs without screwing up the formatting. If every paragraph started with the same <p> tag, but rendered the CSS based on the prior formatting tag, that would be great.
I can't use any server-side tricks.
Thanks.
I know how to do this using classes, (e.g. "<p class='format1'>" or "<p class='format2'>") but I'd like something more automated so that authors can freely re-arrange paragraphs without screwing up the formatting. If every paragraph started with the same <p> tag, but rendered the CSS based on the prior formatting tag, that would be great.
I can't use any server-side tricks.
Thanks.