下拉项目中的文本重叠项目 [英] Text overlapping items in Dropdown items

查看:71
本文介绍了下拉项目中的文本重叠项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,所以我有这种情况下,如果一个页面包含文本和文本包含 UL 列表与一些项目,那些 LI 项目将与下拉列表中的项目重叠,然后用户向下滑动下拉列表。

Hey so I have this case where if a page contains text and text contains a UL list with some items, those LI items will overlap the items in dropdown then the user slides down the dropdown.

我认为我通过在下拉列表中添加以下内容来修复它。 / p>

I thought I had it fixed by adding the following to Div around my dropdown.

position:relative; z-index:999999;

给我

#source-programs-dd { overflow: auto; background: #fff; max-height: 198px; position:relative; z-index:999999;}


推荐答案

为了帮助直接解决你的问题,我需要看到你的HTML和CSS。但一般来说IE7有一个已知的z-index问题,以及如何计算子元素的z-index。

To help directly solve your question, I'll need to see your HTML and CSS. But in general IE7 has a known issue with z-index and how it calculates z-index for children elements.

这个问题有几个Stackoverflow问题。以下是一些可以帮助您:

There are several Stackoverflow questions around this issue. Here are some that could help:

IE7 Z-Index问题 - 上下文菜单

expanding the menu appearing underneath the gallery in IE7

>一般的想法是在IE7中,z-index计算在兄弟姐妹的父元素。这听起来有点奇怪,这里有一个例子:

The general idea is that in IE7, z-index is calculated at the parent element of siblings. That sounds a little odd so here's an example:

<div id="parent1">...</div>
<div id="parent2">...</div>

如果.parent1的UL菜单与.parent2重叠,则可能是.parent2

If .parent1 has something like a UL menu that overlaps .parent2, it could be possible that .parent2 appears in front of that content no matter what z-index any child element of .parent1 has.

这是因为IE7比较z-索引的任何子元素

This is because IE7 compares the z-index of .parent1 and .parent2 and will make all children elements inherit their value, in a sense. (child elements actually get their own z-index context related to each other. But children of other parent elements are influenced by their parent first, in relation to child of other parents)

解决方案是找到导致问题的2个元素,并找到它们共享父元素的彼此兄弟对象的位置。

The solution is to find the 2 elements that are causing the problem and find where they share parent elements that are siblings of each other.

然后应用适当的z-index

Then apply proper z-index on those elements.

.parent1{ z-index:10; }
.parent2{ z-index:1; }

如果您发布了HTML,我可以尝试帮助找到您的确切问题。

If you post your HTML I can try to help find your exact issue.

干杯!

这篇关于下拉项目中的文本重叠项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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