头闻号

李小亚

彩妆化学品|皮肤用化学品

首页 > 新闻中心 > 科技常识:css设置z
科技常识:css设置z
发布时间:2023-02-01 10:44:15        浏览次数:3        返回列表

今天小编跟大家讲解下有关css设置z-index 失效的解决方法 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关css设置z-index 失效的解决方法 的相关资料,希望小伙伴们看了有所帮助。

<!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> 提示:您可以先修改部分代码再运行

来源:爱蒂网