468,316 Members | 2,087 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,316 developers. It's quick & easy.

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

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

Similar topics

1 post views Thread by Philip | last post: by
16 posts views Thread by Geoff Cox | last post: by
2 posts views Thread by Luke Bellamy | last post: by
3 posts views Thread by Phil Thompson | last post: by
5 posts views Thread by User | last post: by
12 posts views Thread by Jarno Suni | last post: by
9 posts views Thread by Radium | last post: by
6 posts views Thread by Markus Ernst | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.