当一个元素的内容可能比分配给它的空间更大时,应该怎么办?

WBOY
WBOY 转载
2023-08-23 22:05:02 210浏览

当一个元素的内容可能比分配给它的空间更大时,应该怎么办?

示例

<html>
   <head>
   </head>
   <style>
      .scroll{
         display:block;
         border: 2px solid green;
         padding:10px;
         margin-top:10px;
         width:300px;
         height:50px;
         overflow:scroll;
      }
      .auto{
         display:block;
         border: 2px solid green;
         padding:10px;
         margin-top:10px;
         width:300px;
         height:50px;
         overflow:auto;
      }
      </style>
      <body>
         <p>Example of scroll value:</p>
         <div class = "scroll">
            This is Demo Content. This is Demo Content. This is Demo Content.
            This is Demo Content. This is Demo Content. This is Demo Content.
            This is Demo Content. This is Demo Content. This is Demo Content.
            This is Demo Content. This is Demo Content. This is Demo Content.
         </div>
      <br />
   </body>
</html>

以上就是当一个元素的内容可能比分配给它的空间更大时,应该怎么办?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除