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

Description

Author: dasch

Description:
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 http://de.wikipedia.org/wiki/Wikipedia:VV#Langer_Pre-Text


Version: 1.16.x
Severity: enhancement

bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz22060.
bzimport created this task.Via LegacyJan 8 2010, 5:01 PM
bzimport added a comment.Via ConduitJan 9 2010, 5:51 AM

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.

bzimport added a comment.Via ConduitJan 9 2010, 1:00 PM

dasch wrote:

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

Bawolff added a comment.Via ConduitJan 10 2010, 7:54 AM

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)

bzimport added a comment.Via ConduitJan 10 2010, 6:07 PM

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.

TheDJ added a comment.Via ConduitJan 15 2010, 10:16 PM

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.

Bawolff added a comment.Via ConduitJan 15 2010, 11:24 PM

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.Via ConduitApr 5 2010, 5:38 PM
  • This bug has been marked as a duplicate of bug 414 ***
Krinkle added a comment.Via ConduitJun 22 2012, 2:43 AM
  • This bug has been marked as a duplicate of bug 260 ***

Add Comment