IE8 Bug I need to fix? All other browsers are fine. I just noticed that IE8 is fubaring some of my code examples. All my code examples go into a pre with a max-height of 340px and a width of 500px. But whenever the code exceeds the 500px width (even if it’s only one line tall!), it blows out the pre to it’s max height of 340px. Here is some code to test if you’d like. I tried for about twenty minutes trying different things to no avail. Thanks!
Uh - Thanks Ray and Maleika! As you mentioned, I also tend to shy away from hacks like that (Usually I’d rather cut my nose off despite my face). Maybe I’ll just let IE8 look bad. Do you guys know what what the none/9 are doing - is there any rhyme-or-reason to that - or just a lucky hack? Thanks!
I admit I haven’t a clue, Eric which is why I’m not sure whether or not this is a good idea. Well, hacks are rarely a good idea, but I haven’t come across a cleaner workaround when searching for this particular bug.
You could just leave it as it is (without the hack) or perhaps you could remove the max-height for a more consistent layout for all browsers.
@Maleika
Sorry, I didn’t mean to repeat the same answer as yours. It looks like I was 2-minutes behind you and I didn’t refresh my tab.
Do you guys know what what the none/9 are doing - is there any rhyme-or-reason to that - or just a lucky hack? Thanks!
Eric I would have to say that belongs in the lucky hack with no rhyme or reason category.
I like the comment at the bottom of the page of Maleika’s link.
So you thought Internet Explorer 8 wouldn’t cause extra work?
Think again…
Just the other day I was saying how impressed I was with IE8, not so sure now. Why in the world are they having regressions into bugs that were not even in IE7.
The main difference with the bug you spotted is that ‘overflow:auto’ can be a trigger only if a ‘width’ value (other than ‘auto’) is set; in the original bug, ‘overflow:auto’ wasn’t a condition under any circumstance.
I’m still trying different things. I think I found a better alternative/hack/work-around for this bug. While the already mentioned hack does remove the blowout height, it also removes the max-height. So if I was displaying a lot of code, my pre (in IE8) would be very tall and not limited at all. So this may be a better alternative depending. Still not content with it though. I will continue to experiment…
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{ visibility: inherit; } Testing</title>
<style type="text/css">
<!--
pre {
display:block;
border:#000 solid 1px;
overflow:auto;
max-height:340px;
width:500px;
padding:10px;
background:#ccc;
margin:2em 0;
}
-->
</style>
[B]<!--[if IE 8]>
<style type="text/css">
pre{word-wrap:break-word;}
</style>
<![endif]-->[/B]
</head>
<body>
<pre>TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText</pre>
[B]And see with 340px max-height!
[/B]
<pre>TextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextTextText</pre>
</body>
</html>