微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html5中overflow是什么意思

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

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

意思:HTML溢出;

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

语法:

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

属性值:

45~7LS0YHSE88WTA)MD@LHH.png

实例

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

<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视频教程

原文地址:https://www.jb51.cc/html5/1199745.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。