DIV中在IE7 UL导致问题 [英] div inside ul causing problems in IE7

查看:312
本文介绍了DIV中在IE7 UL导致问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个< UL >其中包含许多利斯和申报单。李的从输入和标签自动生成,而div的是浮动的权利和作为工具提示解释每个输入。

在code是东西如下:

 < UL>
  < D​​IV>提示< / DIV>
  <李>输入< /李>
  < D​​IV>提示< / DIV>
  <李>输入< /李>
  < D​​IV>提示< / DIV>
  <李>输入< /李>
< / UL>
 

这工作正常在Firefox和IE8,但在IE7中,它假定每个div是的previous一部分<李>,并完全丢弃<从跨preTED源$ C ​​$ C(从IEtester的查看源文件code开发工具发现)/李>标签。任何人都知道为什么发生这种情况,如何ammend呢?

CSS:

  .tooltip {浮动:权利;宽度:140px;字体大小:0.9em;填充:9px 9px 9px 15px的;的margin-top:15px的; }
 

解决方案

您不能有格的&LT内部; UL> 直接。他们可以去&LT内部;李> 元素虽然。这可能会或可能不会帮助你有,但应该是固定的,以确保它是不是原因的问题。

 < UL>
  <李>输入< D​​IV>提示< / DIV>< /李>
  <李>输入< D​​IV>提示< / DIV>< /李>
  <李>输入< D​​IV>提示< / DIV>< /李>
< / UL>
 

I have a <ul> which contains many lis and divs. The li's are autogenerated from inputs and labels, and the divs are floated right and serve as tooltips to explain each input.

The code is something as follows:

<ul>
  <div>tooltip</div>
  <li>input</li>
  <div>tooltip</div>
  <li>input</li>
  <div>tooltip</div>
  <li>input</li>
</ul>

This works fine in firefox and IE8, but in IE7, it assumes that each div is part of the previous <li>, and completely drops the </li> tags from the interpreted source code (found out from IEtester's View Source Code dev tool). Anyone know why this is happening and how to ammend it?

CSS:

.tooltip { float: right; width: 140px; font-size: 0.9em; padding: 9px 9px 9px 15px; margin-top: 15px; }

解决方案

You can't have div inside the <ul> directly. They can go inside the <li> elements though. This may or may not help with the problem you're having but should be fixed to make sure it isn't the cause.

<ul>
  <li>input<div>tooltip</div></li>
  <li>input<div>tooltip</div></li>
  <li>input<div>tooltip</div></li>
</ul>

这篇关于DIV中在IE7 UL导致问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆