请问下 div 布局应用的问题

来源:百度知道 编辑:UC知道 时间:2024/06/28 14:55:25
我想让 右边这个div 在main 里 全屏 左边这个div 悬浮在右边这个div的上面 靠左 我我直接设 zindex 但是也不对 请问该如何设置呢

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type='text/css'>
.divFrame{
width:100%;
height:100%;
margin: 0px;
padding: 0px;
margin-top:0px;
margin-left:0px;
}
.top{
width:100%;
border:0 px double red;
}
.main{margin-top:0px; width:100%;height:100%}

你具体希望达到的效果我不知道哈,不过你的大概效果是左边层和右边层高度都为100%,且左边层要高于右边层,并且希望达到全屏。 我帮你改了两句CSS,你直接把你的替换了就是了。其中的具体定位数值啊这些的你自己可以修改的,也可以锻炼下自己。
.left{border:0px double red;width:270px;height:100%;background-color:#FF0000;z-index:9999; position:absolute; left:0; top:0;}
.right{border:0px double red;width:100%;height:100%;background-color:black; position:absolute; z-index:1; left:0; top:0;}