I have an element which may contain very big amounts of data, but I don\'t want it to ruin the page layout, so I set max-height: 100px and overflow:auto>
Set max-height only and don't set the overflow. This way it will show scroll bar if content is more than max-height and shrinks if content is less than the max-height.