首页 > 解决方案 > 如何调整内容div的高度?

问题描述

我的应用中有标题 div、导航 div 和内容。如果需要,我想将 div 内容的高度调整为内容并使用滚动条。

div的CSS:

// the parent div
.bookManage {
    height: 100%;
}

.books {
    border-left: 1px solid gray;
    overflow: auto;
    height: 60%; // it is work only for specific number of elements. When I added more elements the height doesn't increase.
}

我也尝试:

// the parent div
.bookManage {
    height: 100%;
}

.books {
    border-left: 1px solid gray;
    overflow: auto;
    min-height: XXpx \ XX%; // the size of the div doesn't increase 
}

在此处输入图像描述 有任何想法吗?

标签: css

解决方案


推荐阅读