co******@hotmail.com (Colin Thomas) wrote:
I am having an issue where I need to display preformatted text
(already has the <pre> tag) within a area that I designate with
stylesheets.
It is usually best to start from reconsidering the need to display
preformatted text. For this purpose, it is instructive to think how
<pre> maps to a combination of font-family and white-space, and the
latter is actually a conglomerate of logically different properties.
So which features do you really need?
How can I get the area specified in a css class to stay
the same width and scroll to show the preformatted text. Right now,
the pre tag is causing the area to widen.
Advanced browsers seem to do what you want if you use
pre { display: table; }
and on IE the problem does not appear, since it incorrecty expands the
width of the block, instead of letting the content overflow. I'm not
sure of what your last sentence means.
If you mean that you would like the content to be _separately_
scrollable, then using <iframe> to embed a plain text file might be the
most practical solution. But you could also use
pre { overflow: scroll; }
--
Yucca,
http://www.cs.tut.fi/~jkorpela/