Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Internet Explorer中的相对定位_Css - Fatal编程技术网

Css Internet Explorer中的相对定位

Css Internet Explorer中的相对定位,css,Css,我有一个名为#info box的div,我希望它有点透明。为了使这个div中的元素不透明,你必须对它们应用一个相对位置,使其看起来像是在#info box div中。这对我来说在Chrome中很好,但在Internet Explorer中,内容只是遵循正常的流程。我做错了什么 您可能想创建类似这样的东西(伪代码)。non\u transparent\u child是实际的容器,而不是将透明度放在它后面,而是在它后面有一个transparent\u child来模拟它。它们都包含在可移动的定位容器

我有一个名为#info box的div,我希望它有点透明。为了使这个div中的元素不透明,你必须对它们应用一个相对位置,使其看起来像是在#info box div中。这对我来说在Chrome中很好,但在Internet Explorer中,内容只是遵循正常的流程。我做错了什么

您可能想创建类似这样的东西(伪代码)。
non\u transparent\u child
是实际的容器,而不是将透明度放在它后面,而是在它后面有一个
transparent\u child
来模拟它。它们都包含在可移动的
定位容器中

<wrapper>
    <positioned_container>       //parent that contains the two
        <transparent_child>      //this is your transparent stuff 
        <non_transparent_child>  //this will contain normal stuff
    </positioned_container>
</wrapper>

//relative so that the absolute children will be based from here
positioned_container{
    position:relative;
}

//set to stretch with the parent
transparent_child {
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
}

//包含两个
//这是你的透明材料
//这将包含正常的东西
//相对的,这样绝对的子对象将从这里开始
定位集装箱{
位置:相对位置;
}
//设置为与父对象一起拉伸
透明儿童{
位置:绝对位置;
排名:0;
底部:0;
左:0;
右:0;
}

您可能希望将这些内容精简为基本元素和样式。问题可能是由受影响元素之前的代码引起的