By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,879 Members | 1,809 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,879 IT Pros & Developers. It's quick & easy.

style sheets, preformatted text, and word-wrappin/scrolling

P: n/a
Hey,

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. 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.

Thanks,
Colin
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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/
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.