Help and Support
 

powered byLive Search

All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer

Article ID:262161
Last Review:May 21, 2007
Revision:6.2
This article was previously published under Q262161
On This Page

SYMPTOMS

All style tags after the first 30 style tags on an HTML page are not applied. Occasionally, you may also receive the following error message:
The page you are looking for might have been moved or had its name changed.
If you use a network monitor tool to capture network traffic, you may notice that a TCP reset occurs when Internet Explorer is receiving the page. Internet Explorer then generates another POST request if the original request was a POST request. Or, Internet Explorer may send a GET request instead.

This style tag limitation may also affect the viewing of .xml files by using .xsl files. When the .xsl file has style tags embedded inside the document, you receive the following error message when you try to view the .xml file:
Internet Explorer could not open the Internet Site: file://c:\aaa.xml
When you click OK, you receive the following error message:
The page cannot be displayed

Back to the top

CAUSE

There is a limit of 30 style tags in Internet Explorer.

Back to the top

RESOLUTION

To work around this limitation, combine multiple classes into a single style tag.

Back to the top

MORE INFORMATION

It is not important if you use an inline style sheet, or if you point to a cascading style sheet (CSS) file. The problem occurs in either case.

The code sample that is provided in the "Steps to reproduce the behavior" section dynamically creates style sheets. And, you receive the following error message:
A Runtime Error has occurred.
Do you wish to Debug?

Line: 8
Error: Invalid argument.
If the style sheets are not applied dynamically but are instead applied through <Style> tags or CSS files, no "Invalid argument" error occurs. In this case, all style sheets beyond the thirtieth style sheet are ignored.

Back to the top

Steps to reproduce the behavior

Paste the following code sample in an HTML page. Run the code sample. An error is generated when the thirty-first style tag is applied.
<html><head>

<script>

function fnCreateStyleSheets()
{
  for (i=0 ; i < 31; i++)
  {
    document.createStyleSheet()
    StyleSheetCount.innerText = "Total Style Sheets = " + i
  }
}

</script>

</head><body onLoad="fnCreateStyleSheets()">

<div id="StyleSheetCount"></div>

</body></html>
				

Back to the top

REFERENCES

For more information, visit the following Microsoft Developer Network (MSDN) Web sites:
Style element style object
http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/style.asp (http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/style.asp)


Internet Explorer updates
http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)

Back to the top


APPLIES TO
Microsoft Internet Explorer 4.0 128-Bit Edition
Microsoft Internet Explorer 4.01 Service Pack 2
Microsoft Internet Explorer 4.01 Service Pack 1
Microsoft Internet Explorer 5.0
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0
Microsoft Internet Explorer 6.0 Service Pack 1

Back to the top

Keywords: 
kbtshoot kbscript kbprb kbdhtml KB262161

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by Email, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.