菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>小鸟启蒙(facesoho.com)</title> <style> div.ex1 { background-color: lightblue; width: 110px; height: 110px; overflow: scroll; } div.ex2 { background-color: lightblue; width: 110px; height: 110px; overflow: hidden; } div.ex3 { background-color: lightblue; width: 110px; height: 110px; overflow: auto; } div.ex4 { background-color: lightblue; width: 110px; height: 110px; overflow: visible; } </style> </head> <body> <h1>overflow 属性</h1> <p>如果元素中的内容超出了给定的宽度和高度属性,overflow 属性可以确定是否显示滚动条等行为。</p> <h2>overflow: scroll:</h2> <div class="ex1">小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!</div> <h2>overflow: hidden:</h2> <div class="ex2">小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!</div> <h2>overflow: auto:</h2> <div class="ex3">小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!</div> <h2>overflow: visible (默认):</h2> <div class="ex4">小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!小鸟启蒙 -- 学的不仅是技术,更是梦想!!!</div> </body> </html>
运行结果