IE< DIV>图层和z-index问题 [英] IE <DIV> layer and z-index question

查看:76
本文介绍了IE< DIV>图层和z-index问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个小问题,也许你可以帮帮我。


我有一层用于使页面上的所有内容变暗(不透明度

50%)使其他图层更加可见。


如果我显示两个单独的图层 - 带有z-index的darkenLayer:1和一个

其他图层使用z-index:2 - 一切正常。但是我想做这样的事情:


< DIV id =" darken">< / DIV>


< DIV id =" someDIV">


< TABLE>< TR>< TD>

< DIV id =" someChildDIV" blablalbal


< DIV id =" doNotDarkenThisDiv"重要的DIV< / DIV>


< / DIV>


< / TD>< / TR>< / TABLE>

< / DIV>

我的问题是 - 如何制作DIV - doNotDarkenThisDiv超过

变暗的DIV。我尝试为doNotDarkenThisDiv设置更高的z-index然而

这并没有解决问题。我看了几页,看了很多谷歌

但仍然没有任何线索。在我的情况下''变暗''DIV必须是

位置:绝对,''someDIV''也是......帮助!

I got a little problem, maybe You could help me out.

I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.

If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:

<DIV id="darken"></DIV>

<DIV id="someDIV">

<TABLE><TR><TD>
<DIV id="someChildDIV"blablalbal

<DIV id="doNotDarkenThisDiv" IMPORTANT DIV</DIV>

</DIV>

</TD></TR></TABLE>
</DIV>
My question is - how to make a DIV - doNotDarkenThisDiv to be over the
darken DIV. I tried set higher z-index for doNotDarkenThisDiv however
this do not solved problem. I read a few pages, looking alot on google
and still haven''t got any clues. In my case ''darken'' DIV have to be
position:absolute, and ''someDIV'' too...... Help!

推荐答案

wilqaécrit:
wilq a écrit :

我遇到了一个小问题,也许你可以帮帮我。

我有一层用于使页面上的所有内容变暗(不透明度

50%),以使其他图层更加可见。


如果我显示两个单独的图层 - 带z-index的darkenLayer:1,以及带有z-index的其他图层:

- 一切都可以。但是我想做这样的事情:


< DIV id =" darken">< / DIV>


< DIV id =" someDIV">


< TABLE>< TR>< TD>

< DIV id =" someChildDIV" blablalbal
I got a little problem, maybe You could help me out.

I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.

If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:

<DIV id="darken"></DIV>

<DIV id="someDIV">

<TABLE><TR><TD>
<DIV id="someChildDIV"blablalbal



blablabal必须在< p> aragraph

blablabal must be in a <p>aragraph


< DIV id =" doNotDarkenThisDiv"重要的DIV< / DIV>


< / DIV>


< / TD>< / TR>< / TABLE>

< / DIV>


我的问题是 - 如何制作DIV - doNotDarkenThisDiv超过

变暗DIV 。我尝试为doNotDarkenThisDiv设置更高的z-index然而

这并没有解决问题。
<DIV id="doNotDarkenThisDiv" IMPORTANT DIV</DIV>

</DIV>

</TD></TR></TABLE>
</DIV>
My question is - how to make a DIV - doNotDarkenThisDiv to be over the
darken DIV. I tried set higher z-index for doNotDarkenThisDiv however
this do not solved problem.



不能这样工作...


使用上面的代码,因为变暗是先编码的,这一个是贝娄

以下所有内容


所以......没问题,notDarken(及其表格竞争对手)不会变暗


给''notDarken''一个背景颜色

-

sm

that doesn''t work this way ...

With the code above as the darken is coded in first, this one is bellow
all what follow

So ... no problem, the notDarken (and its table contener) are not darken

Give a background color to your ''notDarken''

--
sm


2月11日,8:18 * pm,SAM< stephanemoriaux.NoAd ... @ wanadoo.fr.invalid>

写道:
On Feb 11, 8:18*pm, SAM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:

wilqaécrit:
wilq a écrit :

我遇到了一些问题,也许你可以帮助我。
I got a little problem, maybe You could help me out.


我有一层用于使页面上的所有内容变暗(不透明度

50%)以制作其他图层更明显。
I have one layer that is used to darken all content on page (opacity
50%) to make other layer more visible.


如果我显示两个单独的图层 - 带有z-index的darkenLayer:1和带有z-的

其他图层index:2 - 一切都好。但是我想做这样的事情:
If i show two separate Layers - darkenLayer with z-index:1, and a
other layer with z-index:2 - everything is ok. But i would like to do
something like this:


< DIV id =" darken">< ; / DIV>
<DIV id="darken"></DIV>


< DIV id =" someDIV">
<DIV id="someDIV">


* *< TABLE>< TR>< TD>

* *< DIV id =" ; someChildDIV" blablalbal
* *<TABLE><TR><TD>
* * <DIV id="someChildDIV"blablalbal



blablabal必须在< p> aragraph


blablabal must be in a <p>aragraph


* * * * *< DIV id =" doNotDarkenThisDiv" *重要DIV< / DIV>
* * * * *<DIV id="doNotDarkenThisDiv"*IMPORTANT DIV</DIV>


* *< / DIV>
* *</DIV>


* *< / TD>< / TR>< / TABLE>

< / DIV>
* *</TD></TR></TABLE>
</DIV>


我的问题是 - 如何制作DIV - doNotDarkenThisDiv超过

变暗的DIV。我尝试为doNotDarkenThisDiv设置更高的z-index然而

这并没有解决问题。
My question is - how to make a DIV - doNotDarkenThisDiv to be over the
darken DIV. I tried set higher z-index for doNotDarkenThisDiv however
this do not solved problem.



不能这样工作...


使用上面的代码,因为变暗首先编码,这一个是贝娄

以下所有内容


所以......没问题,notDarken(及其表格竞争对手)不会变暗


为''notDarken''提供背景颜色

-

sm


that doesn''t work this way ...

With the code above as the darken is coded in first, this one is bellow
all what follow

So ... no problem, the notDarken (and its table contener) are not darken

Give a background color to your ''notDarken''

--
sm



我的意思是所有DIV都有自己的背景。变黑了一个黑色

背景,不透明度为50%,someDiv没有颜色,TABLE和它的

组件有白色背景,而DIV doNotDarkenThisDiv有灰色

背景。我想展示Darken DIV,除了doNotDarkenThisDiv之外,它将超过其他

层。以下是一个问题:

(以下是此示例的完整代码:


< html>

< head> ;

< style type =" text / css">

#darken {

background-color:black;

opacity:0.5;

position:absolute;

filter:alpha(opacity = 50);

width:150;

身高:150;

z-index:11;


}

#someDiv

{

职位:绝对;

z-index:10;

}

#someChildDIV

{

职位:绝对;

}


#doNotDarkenThisDiv
{

background-color:WHITE;

z-index:23;

}

< / style>

< / head>

< body>

< DIV id =" darken"> < / DIV>

< DIV id =" someDIV">

< TABLE>< TR>< TD>

< DIV id =" some ChildDIV一些文字

< DIV id =" doNotDarkenThisDiv"重要的DIV< / DIV>

< / DIV>

< / TD>< / TR>< / TABLE>

< / DIV>

< / body>

< / html>


我想''doNotDarkenThisDiv 超过''变暗''div(所以

doNotDarken的背景......应该是白色的,但它不是(在IE中))。

Anyyone知道任何解决方案吗?

I mean that all DIV-s got own backgrounds. Darken one got black
background with opacity 50%, someDiv have no color, TABLE and its
components got white backgrounds, and DIV doNotDarkenThisDiv have gray
background. I would like to show Darken DIV that would be over other
layers except the "doNotDarkenThisDiv" and here comes a problem :
( Here is complete code for this example:

<html>
<head>
<style type="text/css">
#darken {
background-color : black ;
opacity: 0.5 ;
position : absolute ;
filter : alpha(opacity=50) ;
width : 150;
height : 150 ;
z-index : 11 ;

}
#someDiv
{
position:absolute;
z-index:10;
}
#someChildDIV
{
position:absolute;
}

#doNotDarkenThisDiv
{
background-color : WHITE ;
z-index:23;
}
</style>
</head>
<body>
<DIV id="darken"></DIV>
<DIV id="someDIV">
<TABLE><TR><TD>
<DIV id="someChildDIV"Some text
<DIV id="doNotDarkenThisDiv" IMPORTANT DIV</DIV>
</DIV>
</TD></TR></TABLE>
</DIV>
</body>
</html>

I would like to ''doNotDarkenThisDiv'' be over the ''darken'' div (so
background of doNotDarken... should be white, but it''s not (in IE)).
Anyyone know any solution for that?


wilqaécrit:
wilq a écrit :

>

我的意思是所有DIV都有自己的背景。变暗了一个黑色

背景,不透明度为50%,
>
I mean that all DIV-s got own backgrounds. Darken one got black
background with opacity 50%,



但是...你做了什么似乎工作(在Fx中):


< html>

< head>

< style type =" text / css">

#darken {

background-color:black;

position:absolute;

filter:alpha(opacity = 50 );

-moz-opacity:0.5;

-khtml-opacity:0.5;

opacity:0.5;

宽度:150;

身高:150;

/ *

z-index:11;

* /


}

#someDiv

{

职位:绝对;

z-index:10;

}

#someChildDIV

{

position:absolute;

}


#doNotDarkenThisDiv

{

background-color:WHITE;

/ *

z-index:23;

* /

}

< /风格>

< / head>

< body>

< DIV id =" darken">< / DIV>

< DIV id =" someDIV">

< TABLE> < TR>< TD>

< DIV id =" someChildDIV" some text

< DIV id =" doNotDarkenThisDiv"重要的DIV< / DIV>

< / DIV>

< / TD>< / TR>< / TABLE>

< / DIV>

< / body>

< / html>

but ... what you did seems to work (in Fx) :

<html>
<head>
<style type="text/css">
#darken {
background-color : black ;
position : absolute ;
filter : alpha(opacity=50) ;
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
width : 150;
height : 150 ;
/*
z-index : 11 ;
*/

}
#someDiv
{
position:absolute;
z-index:10;
}
#someChildDIV
{
position:absolute;
}

#doNotDarkenThisDiv
{
background-color : WHITE ;
/*
z-index:23;
*/
}
</style>
</head>
<body>
<DIV id="darken"></DIV>
<DIV id="someDIV">
<TABLE><TR><TD>
<DIV id="someChildDIV"Some text
<DIV id="doNotDarkenThisDiv" IMPORTANT DIV</DIV>
</DIV>
</TD></TR></TABLE>
</DIV>
</body>
</html>


这篇关于IE&lt; DIV&gt;图层和z-index问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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