What I would like to achieve it to apply via CSS some formatting settings to a paragraph only when the paragraph I am referring to is preceded by another paragraph. Examples:
<p>Something</p><p>FORMAT!</p>
<h1>Something</h1><p>DON'T FORMAT!</p>
<p>Something</p><ul><li>Something</li></ul><p>DON'T FORMAT!</p>
The only thing that matters is whether a paragraph is immediately preceded by another paragraph.
I can do this introducing a class to specify whether to apply the formatting or not (something like “first”), but I would like this analysis to be automated.
I already tried first-child without success, the third example would get formatted unless I add additional block structure which would defeat the purpose (then adding the custom class would be simpler…)
See adjacent selectors.