Search Microsoft Support
Search Microsoft.com
Search the web

Article ID: 262161 - Last Review: February 10, 2011 - Revision: 2.0

A webpage that uses CSS styles does not render correctly in Internet Explorer

System TipThis article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article was previously published under Q262161

On This Page

SYMPTOMS
Styles on a webpage are missing or look incorrect when the page loads in the ver...

Styles on a webpage are missing or look incorrect when the page loads in the versions of Microsoft Internet Explorer that are listed in the "Applies to" section.
Note This problem can occur whether the webpage uses an inline style sheet or points to a cascading style sheet.
You may also receive the following error message:
The page you are looking for might have been moved or had its name changed.

CAUSE
This problem occurs because the following conditions are true in Internet Explor...

This problem occurs because the following conditions are true in Internet Explorer:
  • All style tags after the first 31 style tags are not applied.
  • All style rules after the first 4,095 rules are not applied.
  • On pages that uses the @import rule to continously import external style sheets that import other style sheets, style sheets that are more than three levels deep are ignored.

MORE INFORMATION
A network monitor tool may indicate that a TCP reset occurs when Internet Explor...

A network monitor tool may indicate that a TCP reset occurs when Internet Explorer is receiving the page that is experiencing the problem. 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
The code sample that is provided in the "Steps to reproduce the problem" section dynamically creates style sheets and generates 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 through .css files, the "Invalid argument" error message is not generated. In this case, all style sheets after the thirty-first style sheet are ignored.

Steps to reproduce the problem

Paste the following code sample in an HTML page. Run the code sample. An error is generated after the thirty-first style tag is applied.
<html><head>
<script>
function fnCreateStyleSheets()
{
  for (i=1 ; i <= 32; i++)
  {
    document.createStyleSheet()
    StyleSheetCount.innerText = "Total Style Sheets = " + i
  }
}
</script>
</head><body onLoad="fnCreateStyleSheets()">
<div id="StyleSheetCount"></div>
</body></html>
				

REFERENCES
For more information, visit the following Microsoft Developer Network (MSDN) web...

For more information, visit the following Microsoft Developer Network (MSDN) websites:

APPLIES TO
  • Windows Internet Explorer 9
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 6.0
  • Microsoft Internet Explorer 6.0 Service Pack 1
  • Windows Internet Explorer 7
  • Windows Internet Explorer 8
Keywords: 
kbtshoot kbprb kbdhtml kbscript KB262161
 
Provide feedback on this information
Did this information solve your problem?
Yes
No
I don't know
Was this information relevant?
Yes
No
How much effort did you personally put forth to use this article?
Very low
Low
Moderate
High
Very high
What can we do to improve this information?
To protect your privacy, do not include contact information in your feedback.