CSS 参考手册
CSS3 overflow-y 属性
如果它溢出了元素的内容区-剪辑div元素的顶部/底部边缘内容
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> div { width: 110px; height: 110px; border: thin solid black; overflow-x: hidden; overflow-y: hidden; } </style> </head> <body> <div> <p style="width:140px"> In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since. 'Whenever you feel like criticizing anyone,' he told me, 'just remember that all the people in this world haven't had the advantages that you've had.' </p> </div> <p>Overflow-x指定是否要剪辑的左/右边缘的内容.</p> <p>Overflow-y指定是否要剪辑的顶部/底部边缘的内容</p> </body> </html>
运行结果:
点击运行 »