Now, here is two div, one contain another one, if you set parent div filters(such as FILTER: alpha(opacity=80)、opacity: 0.8、-moz-opacity: 0.8), child div's oversteop part will be hidden, this phenomenon equal to set parent div overflow property to "hidden"(only in IE). On the other hand, child div also inherit parent filter property(IE、Firefox), obviously i didn't set any property of child div that as mentioned above, i don't this's why? If who know and had seen this article, please tell me. Thank you very much!
HTML代码:
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml">
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
5
<title>nested div</title>
6
</head>
7![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
<body>
9
asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />
10
asdfjkadfkjhwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<br />
11
<div style="background: #f00; width: 100%; height: 200px; position: absolute; left: 0; top: 0; border: 1px #000 solid; filter: alpha(opacity=80); opacity: 1; -moz-opacity: 0.8; z-index: 0;"><div style="background: #ccc; width: 300px; height: 300px; position: absolute; left: 150px; top: 0; border: 1px #000 solid; z-index: 1;">Now, here is two div, one contain another one, if you set parent div filters(such as FILTER: alpha(opacity=80)、opacity: 0.8、-moz-opacity: 0.8), child div's oversteop part will be hidden, this phenomenon equal to set parent div overflow property to "hidden"(only in IE). On the other hand, child div also inherit parent filter property(IE、Firefox), obviously i didn't set any property of child div that as mentioned above, i don't this's why? If who know and had seen this article, please tell me. Thank you very much!</div></div>
12
</body>
13
</html>
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
专注前端开发,分享&交流技术经验 by 付诸行动
Copyright © 2009-2010 分享前端开发技术博文、工作心得,技术交流
Gtalk: agikoo@gmail.com QQ交流群: 101232616
http://uecode.com/
Copyright © 2009-2010 分享前端开发技术博文、工作心得,技术交流
Gtalk: agikoo@gmail.com QQ交流群: 101232616
http://uecode.com/