Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce the space between <p> tags?

Tags:

html

css

I have a page that I'm converting to PDF. This page contains a number of paragraphs and they don't all fit onto a single page. If I could reduce the spacing between the <p> tags, this would help fit more. Is this possible? Thanks.

like image 748
DaveDev Avatar asked May 07 '10 08:05

DaveDev


People also ask

How do I reduce the space between two p tags?

Setting padding to 0px of the parent paragraph tag will remove the space between parent and child paragraphs if one is inside of another. But If padding of parent is already zero then and still there is space then setting margin to zero of children paragraph tag will remove the space.

How do you change P tag width?

HTML paragraph width Forgive width to <p> tag you need to use CSS style width property. The width property sets the width of a paragraph element. width: auto|value|initial|inherit; Example: setting width 40px in HTML P tag, if the text is more then it will break to the next line.

How do I display P tags on the same line?

The idea of the tag <p></p> is to display a paragraph. So HTML offers you the <div></div> which is a container conecpt. So you should use Salman A's Solution, because there aren't just different tags in html for no reason.


1 Answers

use css :

p { margin:0 } 

Try this wonderful plugin http://www.getfirebug.com :)

EDIT: Firebug is now closed as a project, it was migrated to https://www.mozilla.org/en-US/firefox/developer

like image 103
y_nk Avatar answered Sep 19 '22 06:09

y_nk