User Comments on 'HTML <PRE> tag'
|
Posted by :
Archive Import (Brenden) at 00:30 on Friday, February 14, 2003
|
The only problem with the pre tag is the inability to format the font or any other attributes. I am sure I had found a way around this a long time ago but now nothing I try seems to work. If anyone has worked out a way to use the pre tag with selected fonts please post a reply.
| |
Posted by :
Archive Import (ben) at 10:16 on Wednesday, February 19, 2003
|
To use different fonts (and other formatting, you have to use in-line styles.
eg
<PRE STYLE="font-size: small; font-family:'comic sans ms'">
p.s. always use the comic sans font when doing this because it looks so professional - but fun!
| |
Posted by :
Archive Import (Leo) at 04:39 on Friday, February 21, 2003
|
Simply put, it does not work. If you use comic sans you lose the monospace font... It could still be used for keeping white spaces and linebreak, but it cannot be used for other purposes (guitar tabs and ASCII art are the first that comes into my mind)
However I would rather use a defined style with alla attributes instead of using <PRE>.
| |
Posted by :
Archive Import (John Palmer) at 19:38 on Sunday, March 02, 2003
|
I control font size by putting:
<PRE>
<H5><TT>
---white space preserved text,
font controlled size---
</TT></H5>
</PRE>
I use this code to put typed family trees on my genealogical website. It seems to work with both Explorer and Netscape.
| |
Posted by :
Archive Import (Joey) at 07:47 on Friday, March 21, 2003
|
Is it possible to make it wrap the text?
| |
Posted by :
Archive Import (Cozzo) at 17:41 on Friday, March 21, 2003
|
Is it possible that 2 ppl had the exact same thought on the exact same day?
Posted by : Joey at 07:47 on Friday, March 21, 2003
"Is it possible to make it wrap the text?"
I'm looking for the answer to that exact same question... any one?
| |
Posted by :
Archive Import (dave) at 07:42 on Sunday, March 23, 2003
|
apparently you can try
<p style="white-space: -pre-wrap">text here</p>
or
<p style="white-space: -moz-pre-wrap">text here</p>
but I think they will only work in netscape. Otherwise, no joy I'm afraid.
| |
Posted by :
Archive Import (Hugo) at 11:36 on Wednesday, April 02, 2003
|
In Netscape <pre wrap="on" class="preClass"> works well but can't find a method for IE to wrap text..
| |
Posted by :
Archive Import (Gavin) at 11:15 on Tuesday, April 08, 2003
|
Is there any way to turn wrapping off all together in the body of the page?
| |
Posted by :
Archive Import (Perogi) at 14:52 on Monday, April 21, 2003
|
Another problem with pre is that it will always leave a white space at the front of the first line (per HTML specification).
Otherwise, it is an excellent tag to use to keep formatting intact.
| |
Posted by :
Archive Import (Richard) at 18:57 on Wednesday, April 23, 2003
|
You can use stylesheets and just refernce a class in the PRE tag
ex:
<pre class='body'>text with
new lines
in it
</pre>
| |
Posted by :
Archive Import (Seth) at 20:59 on Saturday, April 26, 2003
|
is there anything wrong with using the <pre> tag? I have searched many places and not many people use this tag, why? and also, is the <pre> tag handled by all browsers? if it is possible can you please email me with an answer, thank you.
| |
Posted by :
Archive Import (das Megabyte) at 10:56 on Thursday, May 08, 2003
|
People don't use the <pre> tag because it offers no display or layout guarantees. Unless it's used as the last element to the right in a left aligned layout, there's a chance that a really long line won't break properly.
Furthermore, it relies on the browser to recognize your file's break type. This doesn't sound like a big deal, but different browsers take different breaks, and different machines use different break mechanisms. The end result is unpredictability.
That said, <pre> is also a wonderful layout tool for small HTML files. I'm not just talking text art...i've used it to perform uniform "tabs" and even to layout images. Plus it's been around since at least HTML 3.2, so you're likely to have a <pre> based layout look identical in every browser you can find.
| |
Posted by :
Archive Import (Kent) at 15:40 on Thursday, May 15, 2003
|
I'm trying to make it quote (in a Help Page) the word 'script' within angle brackets... So far no luck, it assumes I am creating a script, naturally...
| |
Posted by :
Archive Import (James) at 22:50 on Friday, May 16, 2003
|
To make it quote a left angle bracket, instead of typing the angle bracket, type the ampersand symbol (located above the 7 on the keyboard) and then lt;
Similarly, to quote a right angle bracket, use the ampersand symbol and then gt;
So it would look like (and)lt; or (and)gt; where (and) is the ampersand symbol
I'm not going to actually type the code because I'm not sure if it will replace it on the page or not. But this is how to print an angle bracket to the text of a web page.
| |
Posted by :
Archive Import (Guru) at 10:35 on Thursday, June 12, 2003
|
how to print the html format data in the textarea?
Like <b>codetoad</b>
<i>codetoad></i>
It must print like bolded codetoad and italic codetoad
| |
Posted by :
Archive Import (Samuel) at 15:21 on Thursday, July 03, 2003
|
This was a very useful article, it helped me alot, now I dont have to go thru all of that hard stuff, I can use the pre tag for alot of stuff!
| |
Posted by :
Archive Import (Me) at 21:03 on Wednesday, September 03, 2003
|
Can you make fancy html buttons for a school website????
| |
Posted by :
sajet at 02:37 on Thursday, July 15, 2004
|
Whenver i use the <pre> tag, it works fine but seems to put a newline after </pre>
Is this a normal behaviour? any work around technic for this?
| |
Posted by :
gkmone at 08:00 on Saturday, July 30, 2005
|
I am using <PRE> tag in my application and the problems which i face are as follows:
1) First line starts from the center of the page.
2) No wrapping of the text inside this tag.
Please Anyone provide me a useful SOLUTION.
| |
Posted by :
Gnorty at 05:07 on Monday, October 03, 2005
|
Should you wish to ever display html code directly to the screen in fixed face font, the &tl;xmg> does the trick nicely. Not sure how it goes with wrapping text though.
One word of caution -
you MUST remember to close the tag when you are finished, or all the HTML for the rest of the page will be displayed as source code, which is probably NOT what you wanted, and can be very unpleasant in some circumstances.
a safer way, albeit more long-winded is to use \< and \> in place of < and >
i.e. <script> will show as <script>
<Added>
whoops!!
the tag is of course <xmp>
the safer way is to use i.e. < and > instead of < and >
| |
Posted by :
4u2cnnv at 03:07 on Wednesday, February 01, 2006
|
if any one still cares i managed to do this for a textarea that send text a an html format in an email
<textarea id="textarea1" col="80" wrap="hard|soft" ...></textarea>
Response.Write "<pre>" & trim(textarea1.text) & "</pre>"
================
so sumthing like this :
[b]"hello world garbage this is a silly the fox jumped over the lazy dog kinda stuff
best regards
4u2cnnv"[/b]
in this way
[b]"hello world garbage this is a silly the fox jumped over the lazy
dog kinda stuff
best regards
4u2cnnv"[/b]
and not
[b]"hello world garbage this is a silly the fox jumped over the lazy dog kinda stuff best regards 4u2cnnv"[/b]
- bye bye -
| |