1. 程式人生 > >八、overflow:hidden;搭配定位不會被修剪的特殊情況

八、overflow:hidden;搭配定位不會被修剪的特殊情況

<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>overflow:hidden;搭配定位的失效情況</title>    <style>        .father_bother{width: 200px;height: 150px;float: left;border: 1px solid red;        }        .father{width: 200px;height: 150px;border: 1px solid red

;float: left;overflow: hidden;position: relative;        }        .child{width: 600px;height: 400px;background-color: blue;position: absolute;top: 100px;left: 0;        }    </style></head><body><div class="grandfather"><div class="father_bother"></div><div class="father"
>    <div class="child">我是子元素        我是子元素</div></div><div class="father_bother"></div></div></body></html>