Re: problem with <pre> tag



None <kentor@xxxxxxxxx> scripsit:

in FF <pre width=100> whatever text </pre> works fine and wraps the
text so that it won't go crazy and go all over the place but with IE
it messes up and wont wrap the text...

No, IE gets it right and FF gets it wrong. The width attribute <pre>, though defined in HTML specs, has usually been ignored by browsers, which is quite acceptable - it is just a suggestion. It is meant to specify the length of the longest line so that the browser can select a suitable font size, i.e. automatically reduce font size to make the content fit into the browser window, or perhaps reduce indentation that it otherwise uses for <pre> elements. This was a poor idea*) and left unimplemented, but it _is_ the defined meaning. It shall _not_ affect the rendering of the content as regards to division into lines. Ref.:
http://www.w3.org/TR/html4/struct/text.html#h-9.3.4

*) A browser can _calculate_ the length of the longest line. It is awkward to make _people_ count characters.

If you want text to wrap, why are you using the <pre> element, which by definition means _preformatted_ text, i.e. text that has already been divided into lines in a manner that shall be preserved in display? If you have problems with wrapping in <pre>, the odds are that the real problem is that you chose to use <pre>.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

.



Relevant Pages

  • Re: Problem with a session
    ... Your first posting was a bit vague, but now I understand your problem. ... the POSTDATA and sets againg the session variable to true and anyone ... This IS a real problem, and you cannot 100% solve it. ... try to tell the browser NOT to chache it. ...
    (comp.lang.php)
  • HTML Printing problem.
    ... HTML files are to large to print from the browser. ... This is a real problem for the browser. ... Help protect your PC. ...
    (php.general)
  • Re: [Full-Disclosure] IE is just as safe as FireFox
    ... and often do (In the case of Firefox say) but the time to respond is key here. ... MS have a real problem going that extra mile when it comes to patching against variants of a vulnerability ... Microsoft's security and mangement product manager (Ben English) says... ... think that Internet Explorer is any less secure than any other browser ...
    (Full-Disclosure)
  • Re: Are EMs still needed?
    ... browsers should do when first used: ask the user select a suitable font ... for readers with a good browser. ... and Firefox remembers the setting for each ... And, if after reading ...
    (comp.infosystems.www.authoring.stylesheets)
  • Spyware internet browser corruption
    ... I am having a real problem with an infection of my system. ... My browser will ... not maintain my change in options to my home page and reverts back to another ... have used virus scan and multiple spyware softwares as well as regedit to try ...
    (microsoft.public.windowsxp.general)