Use pre { overflow:auto } to avoid overprinting
Closed, ResolvedPublic


Author: dasch

I think pre tags should be formated through CSS with
overflow: auto;
Now the text inserted into pre, when it is to long, breaks the page layout and creates a horizontal scroll

see also

Version: 1.16.x
Severity: enhancement


bzimport set Reference to bz22060.
bzimport added a subscriber: Unknown Object (MLST).
bzimport created this task.Jan 8 2010, 5:01 PM

davidg wrote:

Using style="overflow:auto;" breaks badly in many browsers. So it is better to not use it and instead manually line wrap the examples we put in <pre> tags to avoid making them to wide.

dasch wrote:

well but most users do not wrap manually and whole pages are "broken" because of this

Sometimes I don't want lines in <pre> to wrap.... If it was to introduce automated wrapping, it should be optional: <pre wrap='auto'> or something (pre is treated like an extension tag, and not a literal html <pre> right?).

Also isn't there some work around for IE to make overflow:auto work? (position:relative or something)

ayg wrote:

(In reply to comment #1)

Using style="overflow:auto;" breaks badly in many browsers.

Which browsers, and how does it break? It could just be disabled for those browsers. It appears to work exactly as desired in Chrome 4, Firefox 3.5, and Opera 10.10. IE6 seems to treat it the same as overflow: visible, from a quick test, so it would just be the same as now.

IE6 doesn't support it.

IE7 and 8 draws the scrollbars INSIDE the contentbox (as the only browser, but per the HTML specification). So unless we know of a way to either make the contentbox for IE large enough to fit the scrollbar and have the content readable, this is indeed a tough one.

Well the obvious solution is to give a style rule in IEFixes
pre { padding-bottom: 2em}

(Currently padding is 1em, which is pretty big, and probably almost enough to hold the scroll bar. Perhaps it should be in pixels/absolute units, as i don't think scroll bars vary with font size).

IAlex added a comment.Apr 5 2010, 5:38 PM
  • This bug has been marked as a duplicate of bug 414 ***
  • This bug has been marked as a duplicate of bug 260 ***

Add Comment