# Html and paragraph breaks

**URL:** https://boards.straightdope.com/t/html-and-paragraph-breaks/50595
**Category:** Factual Questions
**Created:** [January 18, 2001, 12:14am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595 "2001-01-18T00:14:05Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Sterra](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Sterra](https://boards.straightdope.com/u/Sterra)
#### Post date: [January 18, 2001, 12:14am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/1 "2001-01-18T00:14:05Z")

</div>

I am currently collecting stories on a website and I do not know how to make it preformat paragraph breaks. Anyone know?🙂

---

<div class="post-metadata">

### Author: ![Shiva](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@Shiva](https://boards.straightdope.com/u/Shiva)
#### Post date: [January 18, 2001, 12:49am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/2 "2001-01-18T00:49:30Z")

</div>

A little more info, please.

What do you mean by “it” and what do you mean by “preformat”? Are you using an HTML editor or writing your own code?

The code for a paragraph break is \<P\> if that’s all you’re asking.

---

<div class="post-metadata">

### Author: ![Sterra](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Sterra](https://boards.straightdope.com/u/Sterra)
#### Post date: [January 18, 2001, 2:26am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/3 "2001-01-18T02:26:23Z")

</div>

preformat=\<pre\>

Well I am mass copying stuff from a forum to text to put on my website. What I wanted to know was is possibly any way to make it so I don’t have to put a \<p\> after every paragraph(there are quite alot of them:))

writing my own code

---

<div class="post-metadata">

### Author: ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)
#### Post date: [January 18, 2001, 2:31am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/4 "2001-01-18T02:31:23Z")

</div>

If you are using \<pre\>, putting \<p\> tags in won’t do anything. The text will be formatted exactly as it was in the original, including line breaks and whitespace.

---

<div class="post-metadata">

### Author: ![Lance\_Turbo](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lance_turbo/32/6156_2.png) [@Lance\_Turbo](https://boards.straightdope.com/u/Lance_Turbo)
#### Post date: [January 18, 2001, 2:35am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/5 "2001-01-18T02:35:03Z")

</div>

You could write a perl script that would place a “\<P\>” after every newline character in the text file.

---

<div class="post-metadata">

### Author: ![Sterra](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Sterra](https://boards.straightdope.com/u/Sterra)
#### Post date: [January 18, 2001, 2:55am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/6 "2001-01-18T02:55:10Z")

</div>

Manduck I assumed thats what would happen. However it didn’t. It removed all spaces like

that.

---

<div class="post-metadata">

### Author: ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)
#### Post date: [January 18, 2001, 2:59am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/7 "2001-01-18T02:59:07Z")

</div>

Well I’ll be darned. Maybe try \<XMP\> then.

---

<div class="post-metadata">

### Author: ![Manduck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/manduck/32/256_2.png) [@Manduck](https://boards.straightdope.com/u/Manduck)
#### Post date: [January 18, 2001, 3:05am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/8 "2001-01-18T03:05:13Z")

</div>

Wait a sec - I just tried out \<pre\> here and it preserved my line breaks and everything, the way it should. Could you be more specific about what effect you want, and what exact problem you’re having?

---

<div class="post-metadata">

### Author: ![Shiva](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@Shiva](https://boards.straightdope.com/u/Shiva)
#### Post date: [January 18, 2001, 3:12am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/9 "2001-01-18T03:12:08Z")

</div>

Yeah, \<pre\> should do the trick. Care to let us take a look at it?

Curious, ain’t it?

---

<div class="post-metadata">

### Author: ![douglips](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@douglips](https://boards.straightdope.com/u/douglips)
#### Post date: [January 18, 2001, 4:12am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/10 "2001-01-18T04:12:30Z")

</div>

Try \<code\> or \<tt\> - it’s been too long for me to remember exactly how this works. Last time I played with HTML was probably 2 years ago.

I recall that \<pre\> is supposed to do this but it doesn’t. I also vaguely recall never being able to do exactly what I wanted to do, so you may be SOL.

---

<div class="post-metadata">

### Author: ![muppetsoup](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@muppetsoup](https://boards.straightdope.com/u/muppetsoup)
#### Post date: [January 18, 2001, 4:12am UTC](https://boards.straightdope.com/t/html-and-paragraph-breaks/50595/11 "2001-01-18T04:12:45Z")

</div>

try \<dd\>

It does a break and an indention. I’ve never seen this tag referenced anywhere, but hey, it works.
