CSS:溢出自动和Z-index [英] CSS: Overflow Auto and Z-index

查看:101
本文介绍了CSS:溢出自动和Z-index的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是链接: http://jsfiddle.net/smnde/2/

overflow:auto 被设置时,是否有办法让列表显示在div上方?就像在第二个容器中一样?

Is there a way to make the list show up above the div when overflow:auto is set? Like in the second container?

推荐答案

是;你可以在任何东西 div 之外显示溢出 div 小孩绝对位置&它是父母没有 position:relative

yes; you can display overflow div outside of anything div when the child is absolute position & it's parent didn't have position:relative

像这样:

like this:

#button {
    border: 1px solid #999;
    margin: 5px;
}

#hidden {
     display: none;
    position: absolute;
    margin-top:-20px;
    left:190px;
    width: 50px;
    border: 1px solid #333;
}

勾选 http://jsfiddle.net/sandeep/smnde/26/

这篇关于CSS:溢出自动和Z-index的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆