开发者

IE6 won't acknowledge new styling implications of dynamically added content

开发者 https://www.devze.com 2023-01-07 20:18 出处:网络
I have most of my page\'s content within <div id=\"ret\">. At some point, this content is wrapped inside a <div id=\"_\"> -- this has all sorts of CSS implications, as there is a styleshee

I have most of my page's content within <div id="ret">. At some point, this content is wrapped inside a <div id="_"> -- this has all sorts of CSS implications, as there is a stylesheet that has already loaded with the page full of rules beginning with the selector #_ #ret{}.

However, the new styling implications are not acknowledged (I've checked with the DOM inspector - o开发者_Python百科stensibly, the contents are styled as if the DOM structure hadn't been changed).

I know from experience that IE is ambiguous with dynamic content and stylesheets, and has numerous issues with the two coming into play, so I tried various hacks to force redraws and re-interpretations - namely document.getElementById('_').innerHTML += ' ';, to force a redraw of the DOM, and document.createStyleSheet(urlToAforementionedCSS), to reload the stylesheet after the DOM has changed. I can see from the status bar and brief FOUCs that both these hacks are indeed causing re-renders, but still it's as if the new cascade's explicit rules in the CSS mean nothing.

What am I missing?


IE6 does not read selectors involving class or id values beginning with anything other than an alphabetic character. -, _, and 0-9 all get ignored.

0

精彩评论

暂无评论...
验证码 换一张
取 消