Pedrumj Pedrumj - 3 months ago 8
HTML Question

Extra Space After Paragraph Tags

Is there a way to user the (

<p></p>
) tags without the extra space on the lines before and after the phrase? I'm using them on wordpress.com.

I'm trying to add a backcolor to some lines but they need to be in
<p></p>
tags so an extra space is not created between the lines.

Is there a non CSS solution? Cause I can't modify the the CSS at the moment.

Answer

There is no way to remove the padding & margin on p elements without the usage of css.

The easiest way to override the fact that you cant add a class or change it in a css file is to add it directly to the p element. This is not valid HTML5 though and should be avoided as much as possible.

Try this out:

<p style="margin: 0;">Text</p>

You can add other styling elements within the style tag too. Things like background colors, padding, etc.

Just remember to avoid using this way it when possible.

Comments