This will show only vertical scroll when content height in div will be greater than 300px.
<div style="overflow-x: hidden; overflow-y: auto; height: 300px;">
----content---
</div>
<div style="overflow-x: hidden; overflow-y: auto; height: 300px;">
----content---
</div>