Pedrumj Pedrumj - 7 months ago 50
HTML Question

Extra Space After Paragraph Tags

Is there a way to user the (

) tags without the extra space on the lines before and after the phrase? I'm using them on

I'm trying to add a backcolor to some lines but they need to be in
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.


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.