English 中文(简体)
IE7随机删除<li>打开和关闭标签
原标题:IE7 randomly deletes <li> opening and closing tags

IE7删除一个标签,并将另一个标签随机放置在标签后面几行。这对我来说毫无意义哈哈。希望有人比我更了解旧IE的工作原理。谢谢你的帮助!

以下是实际代码:

<LI><LABEL>Comments (extra card readers, other questions, etc.) </LABEL><TEXTAREA></TEXTAREA></LI>
</UL>
<TABLE style="MARGIN-TOP: -15px">
  <TBODY>
    <TR>
      <TD><LABEL>By clicking on the submit button below, you warrant that you understand and agree to the terms and conditions of the Merchant Service Agreement.</LABEL></TD>
      <TD><INPUT id=terms type=checkbox name=terms></TD>
      <TD class=status></TD>
   </TR>
 </TBODY>
</TABLE>
<INPUT class=submit value=Submit type=submit name=Submit jQuery1287759194812="2">
</FORM>
<DIV class=clr></DIV>

…但是IE是这样渲染的:

<LI><LABEL>Comments (extra card readers, other questions, etc.) </LABEL><TEXTAREA></TEXTAREA>
<UL></UL>
<TABLE style="MARGIN-TOP: -15px">
  <TBODY>
    <TR>
      <TD><LABEL>By clicking on the submit button below, you warrant that you understand and agree to the terms and conditions of the Merchant Service Agreement.</LABEL></TD>
      <TD><INPUT id=terms type=checkbox name=terms></TD>
      <TD class=status></TD>
   </TR>
 </TBODY>
</TABLE>
<INPUT class=submit value=Submit type=submit name=Submit jQuery1287759194812="2">
</FORM>
<DIV class=clr></DIV>
</LI>
最佳回答

使用W3验证器工具以确保您的标记是正确的。您粘贴了一个甚至没有打开<;ul>;的片段,所以我甚至不太愿意尝试。

很可能你有无效的HTML,它会被当作无效的HTML处理。

问题回答

W3帮助我了解到IE不喜欢ul s中的div容器。将它们切换到ul s内的ul s,它就开始工作了。

It s called normalization. It s an IE7 and IE8 thing that it does with li tags. The only thing that remains in the page is the final /li tag and all others are removed. To be honest the page still renders correctly for me (sometimes) and when you get the innerhtml of anything containing an li tag you see that they are replaced by characters.





相关问题
Image rendered with wrong colors in IE8

I have a gradient image as a PNG (no transparency) in a web-page. By taking a screenshot of Chrome showing the page and cropping the image from the page, I see the exact same colors are drawn as the ...

Determine Mobile Internet Explorer version

I need to determine the version of Mobile Internet Explorer on a Windows Mobile 6.1 device. So that I can report the same user-agent string as is being used by Mobile Internet Explorer. The user-...

CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

Internet Explorer only part loading JavaScript/CSS

I m having trouble with my local development environment where IE (6 through to 8) is only part loading JavaScript/CSS files. It throws random errors at random places in jquery.min.js every time I ...

IE doesn t run Javascript when you click back button

I ve built a shop with tons of JS running. One of the pieces of the cart, is a zip code field which is required to calculate shipping cost. This works fine going through the cart. Now clicking ...

热门标签