Forum Moderators: not2easy

Message Too Old, No Replies

pre tag brakes my layout

and I dont really like overflow: auto

         

alce

9:47 pm on Aug 21, 2006 (gmt 0)

10+ Year Member



I have a simple 2 column layout. The left column is the main content and the right column is a sidebar (navigation, links and so on).

I write a lot of code on the main column (not css obviously lol) using the <pre> and <code> tags. The problem is that whenever any line inside pre tags exceeds the width of the content column, the layout breaks in IE win (not in safari or firefox). I guess I could use overflow: auto but I strongly dislike horizontal scrolling and would like to avoid it.

I don't really mind if the long lines overlap the rigth sidebar like they do in safari and firefox but the sidebar gets thrown to the end of the article in IE.

How do you guys handle this problem?

Thaks

HelenDev

3:46 pm on Aug 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried using
word-wrap:break-word;
?

It's a proprietry IE style but I've used it to stop long email addresses breaking out of a narrow div in IE.

Lynque

2:29 am on Aug 23, 2006 (gmt 0)

10+ Year Member



Not to pop the bubble...

<pre> tags caused a lot lot of cross browser issues for us and in the end we scrapped them.

Not everyone would agree but it just didn't suit our needs.

kiwibrit

8:22 am on Aug 23, 2006 (gmt 0)

10+ Year Member



I decided not to use pre tags. Seemed awkward to handle.