Making a div vertically scrollable using CSS
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This gives a div that the user can scroll in both in horizontally and vertically. How do I change it so that the div is only scrollable vertically? 回答1: You have it covered aside from using the wrong property. The scrollbar can be triggered with any property overflow , overflow-x , or overflow-y and each can be set to any of visible , hidden , scroll , auto , or inherit . You are currently looking at these two: auto - This value will look at the width and height of the box. If they are defined, it won't let the box expand past those