首頁 > web前端 > H5教程 > 主體

html5中overflow是什麼意思

醉折花枝作酒筹
發布: 2023-01-06 11:16:20
原創
16801 人瀏覽過

在html5中,overflow的意思是溢出,該屬性規定如何處理不符合元素框的內容,語法「物件.style.overflow=visible|hidden|scroll|auto」。

html5中overflow是什麼意思

本教學操作環境:windows7系統、CSS3&&HTML5版、Dell G3電腦。

意思:HTML溢位;

overflow 屬性規定如何處理如何處理不符合元素框的內容。

語法:

Object.style.overflow=visible|hidden|scroll|auto
登入後複製

屬性值:

html5中overflow是什麼意思

#實例

本例使用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>
登入後複製

效果:

html5中overflow是什麼意思

推薦學習:html影片教學

以上是html5中overflow是什麼意思的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!