使div可滚动 [英] Make div scrollable

查看:122
本文介绍了使div可滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个div,我显示的许多东西都与笔记本电脑相关的过滤数据。 div随着数据大小的增加而增加。

I have a div that I am displaying many things in that are related to laptop for filtering data. The div increases it's size as the data size increases in it.

我想让div保持最大大小为450px,如果数据增加,滚动会自动出现。 div大小不应该增加。

I want the div to remain at a max size of 450px then if data increases scroll will come automatically. The div size should not be increased.

jsfiddle

css:

.itemconfiguration
{
    min-height:440px;
    width:215px;
    /* background-color:#CCC; */        
    float:left;
    position:relative;
    margin-left:-5px;
}

.left_contentlist
{
    width:215px;
    float:left;
    padding:0 0 0 5px;
    position:relative;
    float:left;
    border-right: 1px #f8f7f3 solid;
    /* background-image:url(images/bubble.png); */
    /* background-color: black; */
}

任何人都可以帮助我实现这一目标?

Can anyone help me achieve this?

推荐答案

当内容超过divs设置的高度时,使用 overflow-y:auto

Use overflow-y:auto for displaying scroll automatically when the content exceeds the divs set height.

这篇关于使div可滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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