html5中overflow是什么意思


本文摘自PHP中文网,作者醉折花枝作酒筹,侵删。

在html5中,overflow的意思是溢出,该属性规定如何处理不符合元素框的内容,语法“对象.style.overflow=visible|hidden|scroll|auto”。

本教程操作环境:windows7系统、CSS3&&HTML5版、Dell G3电脑。

意思:HTML溢出;

overflow 属性规定如何处理如何处理不符合元素框的内容。

语法:

1

Object.style.overflow=visible|hidden|scroll|auto

属性值:

45~7LS0YHSE88WTA)MD@LHH.png

实例

本例使用 overflow 来显示溢出元素框的内容:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

<html>

  <head>

    <style type="text/css">

      div {

        border: thin solid green;

        width: 100px;

        height: 100px;

      }

    </style>

    <script type="text/javascript">

      function hideOverflow() {

        document.getElementById("div1").style.overflow = "hidden";

      }

    </script>

  </head>

  <body>

    <div id="div1">

      This is some text. This is some text. This is some text. This is some

      text. This is some text. This is some text. This is some text. This is

      some text. This is some text.

    </div>

    <br />

    <input type="button" onclick="hideOverflow()" value="Hide overflow" />

  </body>

</html>

效果:

GIF.gif

推荐学习:html视频教程

以上就是html5中overflow是什么意思的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

HTML5用什么工具开发

vue面试题的介绍(附答案)

HTML5中在元素或者选取的文本被拖动时触发的事件ondrag

用js+HTML5实现的小游戏-- 捕鱼达人游戏

HTML5 canvas学习的实例介绍

使用HTML5/css3五步快速制作便签贴特效代码示例分享(图文)

HTML5实践-css3 media queries详情介绍

canvas画直角坐标系

HTML5如何解决margin-top的塌陷问题(附代码)

HTML5新增标签有哪些?

更多相关阅读请进入《HTML5》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...