Friday, February 29, 2008

Internet Explorer and more than 31 Style Tags

Internet Explorer 7 (IE7) appears to have a bug (limit) that ignores more than 31 <style> tags. I wrote it up here since searching for it myself didn't uncover this.

I encountered this in a programatic use of Yahoo's User Interface Library (YUI), where it just so happened that I was outputting more than 30 button instances. Each button was outputting a small style snippet to set a background image as per their example. As a work-around, I'll need to come up with a way to collect all of the styles and then output a single <style> tag.

Here is a snippet that demonstrates this bug if this post is opened in IE, or you can place the HTML in a file and load it up separately. I'll post it on Microsoft's forum and update this if I find anything new.

If any span is not green, the style tag was ignored.
Span 1
Span 2
Span 3
Span 4
Span 5
Span 6
Span 7
Span 8
Span 9
Span 10
Span 11
Span 12
Span 13
Span 14
Span 15
Span 16
Span 17
Span 18
Span 19
Span 20
Span 21
Span 22
Span 23
Span 24
Span 25
Span 26
Span 27
Span 28
Span 29
Span 30
Span 31
Span 32
Span 33
Span 34
Span 35

No comments: