Dec 18 2009
Posted by Webmasters-central.com as Blogging and Autoblogging
Wordpress removes empty lines between paragraphs. Paragraphs supposed to have an empty line so it will be easy to read by the web site vistor and looks neat. But you have to live with that restriction if you want to stay with Wordpress.
Line breaks are what we get when we press ‘Shift+Enter’ on keyboard in WYSIWYG editor. So text will start in new line just below the previous line.
Example:
Line1
Line2
Line3
Line breaks are what we get when we press ‘Enter’ once on keyboard in WYSIWYG editor. So text will start in new line after leaving an empty line.
Example:
Line1
Line2
Line3
Remember … Wordpress DON’T REMOVE <p … /p> tags as such. It ONLY REMOVES the empty lines in between them. So we use this to fix our problem with paragraphs.
1. Login into your WP admin panel.
2. Go to Appearance > Editor > You will see style.css file in the file list on right side.
3. Locate <p> tag in your css file.
Add the following lines to it:
padding-top:1.0em;
padding-bottom:1.0em;
Example:
My p tag is like this:
.post p {
line-height: 1.5em;
margin: 0px 0px 7px 0px;
}
After adding those two lines, it will look like this:
.post p {
line-height: 1.5em;
margin: 0px 0px 7px 0px;
padding-top:1.0em;
padding-bottom:1.0em;
}
Save the file. That is it!
So all paragraphs get a space above and below but shift+enter leaves us with simple line break as we want.
NOTE:
Some times it is difficult to fine ‘p’ tag or you don’t want to change your css. Then add this at the end of your css file and save:
p {
padding-top:1.0em;
padding-bottom:1.0em;
}
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | ||||
9 Responses
Jan
February 17th, 2010 at 9:32 am
1Finally, your solution helped me out a great deal! Thanks!
bob jones
June 21st, 2010 at 10:43 pm
2Phew, thank you so much!
scott
July 12th, 2010 at 6:56 pm
3The onlything that works for me, and doesn’t dissapear after switching to “visual” is adding:
scott
July 12th, 2010 at 6:57 pm
4sorry try this again:
adding the “strong” and “/strong” value between greater than less than
Sarah
August 23rd, 2010 at 1:36 pm
5Well, this makes sense but I still can’t get the paragraph breaks to work. I added
p {
padding-top:1.0em;
padding-bottom:1.0em;
}
to the bottom of my css styles file and saved it, but nothing changed. Any suggestions? It’s a hassle hand coding every blog to include paragraph breaks. Do you think WP will ever fix this?
Webmasters-central.com
August 25th, 2010 at 6:59 pm
6You can try empty <div tag between paragraphs with your desired height.
Junaid
February 23rd, 2011 at 6:17 am
7thanks for this.. helped me.. thanks.
Aussie
September 3rd, 2011 at 8:35 am
8Thankyou, I would never have thought of that work-around. That paragraph problem had been bugging me for months.
Parag
November 21st, 2011 at 1:39 am
9Please help me !! The actual site on which I am working – http://www.rexnordindia.in is under construction, so I m providing you the link of my another site – http://latestpricelistindia.in/wp-content/uploads/2011/11/Sample.jpg I want the content alignment as shown in the link. I have tried P-tag but no avail. Help me !!!!