带滚动条的Div溢出,但没有调整大小选项

时间:2020-07-20 15:06:37

标签: javascript html css

我正在与父母div和孩子div合作。子div需要能够使用滚动条来调整大小,但是父div之外的所有溢出都必须全部隐藏或使用滚动条隐藏,而没有调整大小选项。我提供了一个指向我在JSFiddle中正在研究的代码的链接。我尝试了溢出:隐藏,溢出:自动和溢出:滚动到父div,但没有任何效果。不管是什么(即使是对于溢出:隐藏的),父div的右下角都有“调整大小”拖动图标选项,这正是我所不希望的。如何在不可调整大小的父div内设置可调整大小的子div?

https://jsfiddle.net/9ba54kvp/1/#&togetherjs=4g2SH54efU

PARENT DIV = .tm

CHILD DIV = .overflow

.tm {
    position: absolute;
    top: 8%;
    left: 36%;
    resize: both;
    right: 33%;
    bottom: 50%;
    border-radius: 15px;
    padding: 20px;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow:auto;
    max-height:initial;
}
.overflow {
        overflow: scroll;
    }

我所拥有的屏幕截图(父母将其大小调整为红色圆圈):

enter image description here

我想要的图片(父div中没有​​调整大小选项):

enter image description here

1 个答案:

答案 0 :(得分:0)

只需从resize:both之后的元素中删除<div class="tm">

相关问题