好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

overflow:hiddden与绝对定位的应用场景的事例_html/css_WEB-ITnose

做一个点击查看显示详细信息的效果。

说一下问题描述,最外面的父元素overflow-parent设置了overflow:hidden,

然后子元素overflow-child没有设置overflow,设置了relative,为其包含的绝对定位的元素进行位置确定,这个元素点击时高度增加到300px.

      .overflow-parent{    width: 200px;    height: 200px;    border: 1px solid #ccc;    overflow: hidden;}.overflow-child{    position: relative;    width: 100px;    height: 198px;    border: 1px solid blue;}.position{    position: absolute;    right: 10px;    background: #000;    bottom: top;    top: 110px;    z-index: 100;    width: 50px;    height: 50px;    }.height{    height:300px;}  function addHeight(htmlObj){    $(htmlObj).toggleClass("height");}   

查看更多关于overflow:hiddden与绝对定位的应用场景的事例_html/css_WEB-ITnose的详细内容...

  阅读:34次