修复了我的窗口滚动条上的 div



我的问题是我在页面底部修复了带有免责声明等的div。

这个 DIV 与垂直滚动条重叠,所以我从父元素中删除了溢出。

现在它正在工作,但我需要父元素的溢出才能在滚动页面时查看更多内容。

有人可以帮助我吗?

看看这个:斯菲德尔

#scrollable
{
    position: absolute; 
    width: 100%; 
    height: 100%; 
    top: 0; 
    left: 0;
    z-index: 2; 
    margin:0;
    padding:0;
}
div.bottom
{
    background-color: #fa0000;
    position:  fixed;
    bottom: 0%;
    /*height: 10%;*/
    height: 80px;
    width: 100%;
    margin:0;
    padding:0;
    z-index:9999;
}
div.test
{
    border-radius: 10px 10px 10px 10px;
    -moz-border-radius: 10px 10px 10px 10px;
    -webkit-border-radius: 10px 10px 10px 10px;
    position: absolute;
    top : 10px;
    background: #000000;
    height: 1500px;
    width: 100%;
    margin-bottom: 80px;
    margin:0;
    padding:0;
}

您必须设置容器的高度。高度应该足以使免责声明div 可见。然后将溢出:自动提供给容器。这将处理滚动和重叠。

可以根据页面的 DOM 结构计算高度。但请给出适当的高度。

溢出的概念非常简单,当您的内容"oveflows"时,如果您已指定溢出属性,则会出现滚动条。在您的情况下, 溢出正在发生 ,但由于可用高度更多,它超出了您的免责声明div。只需减少它,以便您的免责声明div 和容器div 不会重叠。你应该没事

如果您发布了代码和页面结构,则解释起来会更简单。

最新更新