为什么它在IE 7中没有按预期工作?

时间:2021-11-03 02:17:24

为什么它在IE 7中没有按预期工作?

为什么它在IE 7中没有按预期工作?

Due to Intellectual Property issues with the client I just can't discuss any code.

由于与客户的知识产权问题,我只是无法讨论任何代码。

There is a line or space between two LI tags in IE7 which are not present in Firefox or Chrome.

IE7中两个LI标签之间有一条线或空格,在Firefox或Chrome中不存在。

I tried very hard to detect where is the problem. I think after 6 hourse of try. So any fresh ideas would be helpful.

我非常努力地发现问题出在哪里。我想经过6个小时的尝试。所以任何新鲜的想法都会有所帮助。

1 个解决方案

#1


2  

First, try to integrate a good CSS Reset (good one you can found on www.html5boilerplate.com ).

首先,尝试集成一个好的CSS重置(你可以在www.html5boilerplate.com找到一个好的重置)。

Second, I can only suppose menu CSS/HTML code (why you don't publish here the code? When is online, EVERY person can read your css/js/html code!):

其次,我只能假设菜单CSS / HTML代码(为什么你不在这里发布代码?什么时候在线,每个人都可以阅读你的css / js / html代码!):

HTML:

HTML:

<div class="menu">
  <ul>
     <li>menu item</li>
     <li>menu with subitem
         <ul>
            <li>sub menu item</li>
            ...
         </ul>
     </li>
     ...

CSS:

CSS:

.menu ul {
   ...

}

}

I can suggest this kind of reset:

我可以建议这种重置:

.menu ul, .menu li {
   margin: 0 !important;
   padding: 0 !important;
   display: block;
   list-style: none;
}

and try to obtain other padding/spacing with sub elements (span, a, ecc.).

并尝试使用子元素(span,a,ecc。)获得其他填充/间距。

#1


2  

First, try to integrate a good CSS Reset (good one you can found on www.html5boilerplate.com ).

首先,尝试集成一个好的CSS重置(你可以在www.html5boilerplate.com找到一个好的重置)。

Second, I can only suppose menu CSS/HTML code (why you don't publish here the code? When is online, EVERY person can read your css/js/html code!):

其次,我只能假设菜单CSS / HTML代码(为什么你不在这里发布代码?什么时候在线,每个人都可以阅读你的css / js / html代码!):

HTML:

HTML:

<div class="menu">
  <ul>
     <li>menu item</li>
     <li>menu with subitem
         <ul>
            <li>sub menu item</li>
            ...
         </ul>
     </li>
     ...

CSS:

CSS:

.menu ul {
   ...

}

}

I can suggest this kind of reset:

我可以建议这种重置:

.menu ul, .menu li {
   margin: 0 !important;
   padding: 0 !important;
   display: block;
   list-style: none;
}

and try to obtain other padding/spacing with sub elements (span, a, ecc.).

并尝试使用子元素(span,a,ecc。)获得其他填充/间距。