css样式filter absolute的问题
css中 position: absolute;了 高度和宽度就不能用百分比了 怎么办法啊?
代码如下:
<!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=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body{
margin:0;
padding:0;
font-size:12px;
background-image:url(default2/bg1.jpg);
}
#divAll{
width:860px;
z-index:3;
position: absolute;
top:0px;
left:70px;
}
#divall_bg{
position: absolute;
width:860px;
height:90px;/*我想高度跟divAll一样啊 怎么办啊?*/
top:0px;
left:70px;
background-color:#000000;
filter:alpha(opacity=10);
z-index:0;
}
-->
</style>
</head>
<body>
<div id="divAll">
L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>L<br>
</div>
<div id="divall_bg"></div>
</body>
</html>
[解决办法]
css里不用给divall_bg设置高度,HTML代码部分这样改即可:
<div id="divall_bg">
<div id="divAll">
L <br> L <br> L <br> L <br> L <br> L <br> L <br> L <br> L <br> L <br> L <br>
</div>
</div>
[解决办法]
可以用js控制!