首页
极刻
圈子
教程
开源
登录 / 注册
返回教程:CSS 教程
TRY RUN / 在线示例
CSS 教程 如何使用滚动条来显示元素内溢出的内容
CSS 教程 如何使用滚动条来显示元素内溢出的内容
源代码
运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>安科教程(www.ancii.com)</title> <style> div.scroll { background-color:#00FFFF; width:100px; height:100px; overflow:scroll; } div.hidden { background-color:#00FF00; width:100px; height:100px; overflow:hidden; } </style> </head> <body> <p>overflow 属性规定当内容溢出元素框时发生的事情。.</p> <p>overflow:scroll</p> <div class="scroll">You can use the overflow property when you want to have better control of the layout. The default value is visible.</div> <p>overflow:hidden</p> <div class="hidden">You can use the overflow property when you want to have better control of the layout. The default value is visible.</div> </body> </html>
运行结果