有关不透明度、堆叠顺序和消失 div 的 IE 问题
我在 IE 中的代码遇到了一些麻烦,在 Safari 和 Firefox 中一切正常,但在 IE 中却不行。
我的第一个问题是我的一些 div 放置在其他 div 后面,我尝试更改 z-index
,但没有效果。由于这些 div 是 position:absolute
,我认为这也不会有助于更改 HTML 中的 div
顺序。
第二个问题是我无法让不透明度在 IE 中工作,我尝试了 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
和 filter:alpha(opacity=80);
但没有帮助。不透明度对 IE 中的任何内容都不起作用。
第三个问题是我的一张图片完全消失了,在IE中找不到div="kart"
内的图片。我已将 float:left;
应用于 div
,因此当侧面缩放时,它应该在该部分的另一个 div 下方对齐。我觉得很奇怪,我网站上的所有其他 img
都工作正常,我尝试过更改文件格式,但同样没有效果。
如果有人可以看一下,我将不胜感激,我是自学成才的,没有人问这类事情。
为我糟糕的英语道歉,我是外国人..:)
不确定我是否应该包含 HTML 标记和 CSS 样式,所以我只会给你初学者的 url。
该网站位于 http://www.vstil.com
I am having bit of a trouble regarding my code in IE, everything works great in Safari and Firefox, but not in IE.
My first problem is that some of my divs are placed behind other divs, I have tried to change the z-index
, but to no good. Since these divs are position: absolute
, I don't think it will help changing the div
order in the HTML either.
The second problem is that I am not able to get the opacity to work in IE, I have tried the -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
andfilter:alpha(opacity=80);
but to no help. The Opacity doesn't work on anything in IE.
The third problem is that one of my images has disappeared completely, the image inside the div="kart"
is nowhere to be found in IE. I have applied float:left;
to the div
, so it is supposed to line up under the other div in that section when the side scales. I find it rather strange, every other img
on my site is working fine, I have tried changing the file format, but again, to no good.
I would appreciate if someone could take a look at it, I am self-taught and don't have anyone to ask about these kind of things.
And apologies for my poor English, I'm foreign..:)
Not sure if I should include the HTML-markup and the CSS-styles, so I will just give you the url for starters.
The site is located at http://www.vstil.com
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了我的一些问题,如果有人遇到同样的问题,我想分享它。
第一个问题与元素及其父元素的 z 索引有关。在 IE 中,子元素的 z-index 不能高于其父元素,因此我必须将父元素的 z-index 设置为 3,然后我可以将子元素的 z-index 设置为 2 和 1 以使它们正确。
我的第二个问题是不透明度不起作用,因为 IE 需要设置元素的布局。因此,解决方案是设置我分配了不透明度的元素的宽度和高度。
消失的 div 的第三个问题我还没有弄清楚,该站点也已从服务器上移出,现在可以在 www.fanafysioterapi.no 上找到
*编辑:也解决了第三个问题,它与第一个问题类似。该 div 隐藏在另一个 div 后面,因为有些 div 具有相对/绝对位置,而有些则没有。在这里找到我的问题的答案: https://developer.mozilla.org/en/Understanding_CSS_z-index
一遍又一遍。
I have figured some of my problems out and would like to share it if anyone should have the same problem.
The first problem had to do with the z-index of an element and its parents element. In IE a child-element cant have a higher z-index than its parents element, so I had to set the parents z-indez to 3, and then I could set the childs z-index to 2 and 1 to get them correct.
My second problem with the opacity not working was because IE requiers the layout of the element to be set. The solution was therefor to set the width and height of the element which I had assigned opacity to.
The third problem of the disapearing div I have not yet figured out, also the site has been moved from the server and can now be found at www.fanafysioterapi.no
*Edit: Figuered out the third problem too, which was simular to the first. The div was hidden behind another div, because some of the divs had position relative/absolute and some had not. Found the answare to my problem here: https://developer.mozilla.org/en/Understanding_CSS_z-index
over and out.