I still use <PRE> for my web site. I have noticed that the text flows way off the screen to the right. Is there any way to correct this without use of <HR> or hitting ENTER?
Thanks!
I still use <PRE> for my web site. I have noticed that the text flows way off the screen to the right. Is there any way to correct this without use of <HR> or hitting ENTER?
Thanks!

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
The purpose of <pre> ... </pre> tags is to display text exactly as entered, including all spaces (HTML normally suppresses multiple spaces). So you're responsible for breaking lines yourself. If you don't want to do that, you shouldn't use <pre> ... </pre> tags. You can use non-breaking spaces * if you want to insert multiple spaces.
Thank you, but I used to NOT have this problem with my web pages, and that is why I asked. The text would stay within the width of the monitor WITHOUT entering any breaks. I am unable to determine what I am doing differently. So, back to the drawing board...
You could use the alternative and use the <code> tag which does allow wrapping without the need for </br> or </hr> tags to format.
If you are happy (or adventurous) you could try using CSS to do the formatting for you.
Put this code in a HTML file and see how it displays, I have set it to be 50nd with a colour background purely to show how the format changes:
<pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Using the <code> tag with CSS</title>
<style>
.wrap{
background-color: #99FFCC;
width: 50%;
}
</style>
</head>
<body>
<div class="wrap">
<code>Lorem ipsum dolor sit amet,consectetuer adipiscing elit. Donec sollicitudin libero id elit.
Sed euismod nonummy neque.Nam dignissim urna vel urna. Nunc aliquet.Nunc vel dui mattis magna varius condimentum.
Etiam lacus enim, aliquam ultricies,
luctus ut, placerat id, lectus.
Vestibulum laoreet commodo tortor.
</code>
</div>
</body>
</html>
</pre>
Adjust the latin filler text to different lengths on the line and you will see it wrap. I haven't done it here as it affects the view in the Lounge. HTH
Jerry
Thank you, Jezza. You may have given me the "oomph" to start learning CSS.
No probs, if you want to try something else, and be able to provide you with more flexibility you can change the CSS style to use the white-space method which uses the pre format, like so:
<pre><style type="text/css">
.PreTag
{
white-spacere;
width: 50%;
background-color:#99FFFF;
}
</style>
</pre>
Jerry