Forum Moderators: not2easy
CODE {
background-color: rgb(155,155,155);
opacity: 0.75; filter: alpha (opacity=75);
border: 3px groove rgb(155,155,155);
color: rgb(0,0,0);
padding: 4px;
display: block;
white-space: pre-wrap;
}
<?php
if(false !== strstr($_SERVER['HTTP_USER_AGENT'],'MSIE') || false !== strstr($_SERVER['HTTP_USER_AGENT'],'Microsoft'))
echo "<style type=\"text/css\">\nCODE {white-space: pre !important; word-wrap: break-word;}\n</style>";
?> all the whitespace is condensed to a single spaceScrewing up your code indenting, eh? Believe it or don't, IE is actually behaving properly for the CODE tag. The CODE tag is supposed to be mono-spaced like the PRE tag, but it's not supposed to act like it has hard-breaks like the PRE tag. You should probably be using the PRE tag, but then the code wouldn't wrap to fit the DIV container. The real problem is that the "Appendix D. Default style sheet for HTML 4" in the CSS spec under-specifies the default style of the CODE tag, the PRE tag, and a lot of other tags.