Archive for the ‘Browser Bugs’ Category

Internet Explorer 32 styles bug

Sunday, October 25th, 2009

I have found a curious bug in all versions of Internet Explorer. It is new to me and i found no reference to it on the internet, so here goes.

If you have access to a php server, insert the following code into a php file:

<?php

for($i=1;$i<=100;$i++){
?>
<style type = “text/css”>
.style<? echo $i; ?>{
border: purple 1px solid;
height: 100px;
width: 100px;
}
</style>
<div class = “style<? echo $i; ?>”><? echo $i; ?></div>
<?
}

?>

This will output 100 boxes,  each with a separate class reference. There is also 100 class definitions. Viewing this in IE 6,7 and 8 you will see only the first 31 boxes have style!

The workaround for bugs similar to this is to use inline styles instead of class references and this seems to work around it.