手机
当前位置:查字典教程网 >网页设计 > Div+Css教程 >css设置z-index 失效的解决方法
css设置z-index 失效的解决方法
摘要:UntitledPage#king_of_diamonds{position:relative;background-color:gray;...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title> <style type="text/css">#king_of_diamonds { position: relative; background-color:gray; width:30px; height:30px; left: 145px; top: 145px;}#ace_of_diamonds { position:relative; background-color:blue; width:300px; height:300px; left: 160px; top: 130px; z-index: 1;} </style></head><body> <form id="form1" runat="server"> <div id="king_of_diamonds"> a </div> <div id="ace_of_diamonds"> b </div> </form></body></html>

提示:您可以先修改部分代码再运行

【css设置z-index 失效的解决方法】相关文章:

css清除浮动方法和代码

firefox和谷歌不显示body背景图片的解决方法

css控制div不能居中的解决办法

CSS让ul所有的li居中显示的方法

DIV下图片自适应解决方法

垂直三栏布局拥有相同高度的方法

CSS教程:闭合CSS浮动元素的几种方法

清除浮动的空DIV方法

页脚始终保持在页面底部的网页布局方法

CSS设计网页头部的写法

精品推荐
分类导航