If I have user generated content such as:
<p>my paragraph</p>
<ul><li>item1</li>
<li>item2</li>
</ul>
This outputs with a paragraph gap between the end of the paragraph and the list like so:
my paragraph
- item1
- item2
I know I can get rid of the gap in my CSS by setting margin-top on the UL tag and margin-bottom on the p tag but is there a way to do it without affecting the margins between actual paragraphs.
The content is user generated with a limited set of tags available and no fonts, sizes... available so all formatting should be done in CSS if possible without having to put classes in the tags.
EDIT:
Should have put I know because of the way margin collapsing works in CSS I could usually set
p{ margin-bottom:0; }
li { margin-top:0;}
The separation would be correct in both cases as the margin-top property on the p tag would still be 1 but I already set margin-top to 0.2em for a smaller gap between h2 and p tags.