This is a small demo

How to remove the space between paragraphs (p)

How to remove spaces between paragraphs in HTML?

<p class="first">This is a small demo</p> <p class="second">This is second demo</p> 
+6
source share
6 answers

You can use margin: 0; to remove spaces.

 p { margin: 0; } 

If this still does not work, try to do it !important

 p { margin: 0 !important; } 

Check out http://jsfiddle.net/zg7fP/1/

+14
source

Try setting margin-bottom: 0 in the upper paragraph and margin-top: 0 in the lower paragraph

or you can use div instead of paragraph

+3
source

You can set a default value for zero using CSS:

 p { margin: 0px; } 
+1
source

put both inside the same set of p and separately with br

0
source

Try using line-height: 100%; or another percentage that you think reflects well in your HTML.

0
source

You should use p {margin: 0 auto;}

If you want to add indentation (recommended if you remove spaces between paragraphs), a good technique is:

 p + p {text-indent: 1.25em;} 
0
source

Source: https://habr.com/ru/post/953813/


All Articles