div能不能让一个层置于另一层之上

来源:百度知道 编辑:UC知道 时间:2024/05/21 16:13:38
就像ps中那样的,两个层可以上下互换位置,让哪一个作背影都可以.最好能实现两个层不在同一个水平线上.

看看以下的实现方法:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html" charset="gb2312">
</head>

<body leftmargin=0 topmargin=0>
<div id="bgLayer" style="position:absolute;background:#CCCCCC;top:0px;width:100%;height:100%;filter:alpha(style=0,opacity=50);display:none;z-index:9998;"> </div>
<div id="topLayer" style="position:absolute;background:#999999;top:0px;width:420px;height:150px;display:none;z-index:9999;">
<table width=100% height=100% bgcolor="#FFFFFF" style="position:relative;top:-5px;left:-5px;border:solid #999999 1px;">
<tr>
<td><center><input type="button" value="确 定" onclick="j