注意到<!> IE6 和 7(尚未测试 8)开发人员工具栏中的元素。它似乎是一个为保存我的实际元素之一的背景图像而创建的元素(根据 IE,实际元素现在是 元素的子元素)
有谁知道 是什么?元素是什么以及为什么 IE 创建它来保存背景图像(我在该元素旁边有另一个几乎相同的元素,该元素现在是 元素的子元素,并且不需要/获取 元素)背景图像元素)
实际标记(简化)
<div id='d1'>I have a background image</div>
<div id='d2'>So do I</div>
由 IE6 和 7 渲染的标记
<!> <!-- now contains the background image for d1'-->
div id='d1'>I no longer have a background image</div>
</!> <!-- or whatever the closing tag for <!> is -->
<div id='d2'>SI still have mine</div>
编辑:
实际网站可以在此处找到。实际的标记相当大且复杂。 (有问题的元素是 #leftBar 元素,请注意,它的高度由 javascript 确定)
这是描述包裹在 中的元素的所有 CSS。
position:absolute;
left:0px;
z-index:15;
width:15em; /* on update change: #contentWrapper:padding-left, #rondleiding:left */
height:100%;
overflow:visible;
background: url("http://somewhere/img.png") repeat #a99c89;
此外,确实有对页面元素的 JavaScript 操作,但这些操作不处理 #leftBar 元素的背景图像。
根据 W3C 验证器,该页面几乎有效(具有 rels 的图像上存在一些错误)。
此外,我将添加赏金,因为我现在要求人们查看实际的网站(这意味着深入研究我的狗屎)。(忘记一个问题需要开放两天)
In noticed the <!> element in IE6 and 7 (haven't tested 8) developer toolbar. It appears to be an element created to hold the background image for one of my actual elements (the actual element is now a child of the <!> element according to IE)
Does anyone know what the <!> element is and why IE creates it to hold the background image (I have another virtually identical element next to the element that is now a child of the <!> element and that one does not need/gets an <!> element for the background image)
Actual Markup (simplified)
<div id='d1'>I have a background image</div>
<div id='d2'>So do I</div>
Markup as renderen by IE6 and 7
<!> <!-- now contains the background image for d1'-->
div id='d1'>I no longer have a background image</div>
</!> <!-- or whatever the closing tag for <!> is -->
<div id='d2'>SI still have mine</div>
EDIT:
The actual site can be found here. The actual markup is quite big and complex. (The element that is the problem is the #leftBar element, note that this has it's height determined by javascript)
This is all the CSS that descibes the element being wrapped in <!>
position:absolute;
left:0px;
z-index:15;
width:15em; /* on update change: #contentWrapper:padding-left, #rondleiding:left */
height:100%;
overflow:visible;
background: url("http://somewhere/img.png") repeat #a99c89;
Also there are indeed javascript manipulations on the elements of the page, but these do not deal with the background image of the #leftBar element.
According to the W3C validator, the page is pretty much valid (some errors on images having rels).
Also I'll be adding a bounty as I am now asking people to look at the actual website (which means digging into my shit).(forget a question needs to be open two days for that)
发布评论
评论(2)
这是由 ie7/ie8.js 脚本中的错误引起的。我还没有弄清楚如何...调试起来并没有多大乐趣,因为该库是一个由曲折的小功能组成的迷宫。您真的需要包含它吗?如果您想要修复一种特定行为,最好单独解决该问题。我从来没有真正信任过这些一次性修复所有问题的巨大尝试脚本。
因此,我会指出,您似乎加载了 jQuery 两次(一次来自 Google,一次来自您自己的具有错误 MIME 类型的站点),并且您遇到了此验证问题(文档的其余部分似乎没问题):
不幸的是,MSDN 仍在分发这种无效的条件注释语法,因为很容易有一个下层显示的条件注释也有效:
It's being caused by a bug in the ie7/ie8.js script. I haven't worked out how yet... not much fun to debug as that library is such a maze of twisty little features. Do you really need to include it? If there is one specific behaviour you want to fix it may be better to just address that separately. I've never really trusted these enormous attempt-to-fix-everything-at-once scripts.
So instead I'll point out that you seem to be loading jQuery twice (once from Google, once from your own site with the wrong MIME type), and you've got this validation problem (the rest of the doc seems OK):
It is unfortunate that MSDN is still handing out this invalid conditional comment syntax, since it's easy to have a downlevel-revealed conditional comment that's also valid:
真实的(未简化的)标记是否可能包含语法错误?我见过 IE Dev Toolbar 完全因为某些简单的事情而感到抓狂,比如在属性上缺少结束
"
。Is it possible the real (not simplified) markup contains a syntax error? I've seen IE Dev Toolbar completely freak out on things as simple as missing a closing
"
on an attribute.