OVERTONE OVERTONE - 5 months ago 17
CSS Question

remove space above and below <p> tag HTML

So simple enough.

Take this ul for example.

<li>HI THERE</li>
<p >ME </p>

When the innerHtml of an Li tag is blank, the Li wraps itself right up to the text.

It doesn't happen for the P tag. I'm assuming this is because p is for paragraphs which usually have white space breaks before and after.

My question:

Is there any way to remove this?


<p> elements generally have margins and / or padding. You can set those to zero in a stylesheet.

li p {
    margin: 0;
    padding: 0;

Semantically speaking, however, it is fairly unusual to have a list of paragraphs.