I have a div with following style: height:250px;scroll:auto;. I want it to scroll after 250 px but should have height according to the content in it.
For example, if the content in it is 100px, then, the height of div should be 100 without scroll. But, if the height exceeds 250px, it should show scroll.
How can do it?
Is this what you are after?
Demo
CSS:
.dyn-height { width:100px; max-height:250px; overflow-y:scroll; }
height:
optional - just for the demo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With