html5中overflow是什么意思

html5中overflow是什么意思,第1张

html5中overflow是什么意思

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

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

意思:HTML溢出;

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

语法:

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

属性值:

实例

本例使用 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>

效果:

推荐学习:html视频教程

以上就是html5中overflow是什么意思的详细内容,

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/694630.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-22
下一篇 2022-04-22

发表评论

登录后才能评论

评论列表(0条)

保存