Z-index 不适用于嵌入代码 [英] Z-index not working for Embed Code
问题描述
在滚动我的网页时,带有视频的 DIV 不会排在顶部 DIV 后面.在我的网页上有一个顶级 DIV,它具有以下 css 样式
#header{字体大小:11px;高度:25px;位置:固定;顶部:0;宽度:960px;z-索引:1000;}
现在清除所有浮动元素后,我在包装器 DIV 上添加了一个视频,就像这样..
<object>视频代码</object>
应用 CSS
#vedio{位置:相对;文字对齐:居中;z-索引:0;}
在 FireFox3.6、Google Chrome 中,做完所有事情后,视频不会落后于标题.请有人帮帮我.谢谢
您正在测试哪个浏览器?IE 有 z-index:0;
问题,总是以 1
或 -1
开头,然后从那里开始.
将此添加到您的对象中:
并将其嵌入到您的嵌入中:
wmode="transparent"
并记住使用 </embed>
或查看您正在使用的 XHTML 文档类型来关闭您的嵌入标签:/>代码>.我在萤火虫中添加了这些,效果很好:)
你也有 z-index;999;
在 #wp-admin-bar *
上,我将其添加到父级;#wp-admin-bar .padder
只是为了确保孩子们会继承这个值.
While scrolling my web page a DIV which have a video is not going behind the top DIV. On my web page a top DIV,which have folloing css styling
#header{
font-size:11px;
height:25px;
position:fixed;
top:0;
width:960px;
z-index:1000;
}
Now after clearing all floated element,I added a video on a wrapper DIV like same as this way..
<div id="vedio">
<object>video code</object>
</div>
Applying CSS
#vedio{
position:relative;
text-align:center;
z-index:0;
}
After doing all stuff video is not going behind header in FireFox3.6,Google Chrome.Please Someone Help me out. Thank you
Which Browser are you testing in? IE has z-index:0;
issues, always start with 1
or -1
and go from there.
Edit:
Add this to your object:
<param name="wmode" value="transparent">
and this to your embed:
wmode="transparent"
and remember to close your embed tag with either </embed>
or seeing as you're using XHTML doctype: />
. I added these in firebug and it works fine :)
<object width="606" height="385">
<param name="movie" value="http://www.youtube.com/v/RjUIarUAioY&hl=en_US&fs=1&color1=0x2b405b&color2=0x6b8ab6"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<param name="wmode" value="transaprent"></param>
<embed src="http://www.youtube.com/v/RjUIarUAioY&hl=en_US&fs=1&color1=0x2b405b&color2=0x6b8ab6"
type="application/x-shockwave-flash"
allowscriptaccess="always"
allowfullscreen="true"
width="606" height="385"
wmode="transparent">
</embed>
</object>
You also had z-index; 999;
on #wp-admin-bar *
, I added it to the parent; #wp-admin-bar .padder
just to make sure the children would inherit the value.
这篇关于Z-index 不适用于嵌入代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!