CSS2 測量屬性與 CSS3 盒子測量屬性


讓我們理解 CSS2 測量屬性與 CSS3 盒子測量屬性之間的區別。

CSS2 測量屬性

現場演示

<html>
   <head>
      <style>
         .div1 {
            width: 200px;
            height: 100px;
            border: 1px solid green;
          }
         .div2 {
            width: 200px;
            height: 100px;
            padding: 50px;
            border: 1px solid pink;
         }
      </style>
   </head>
   <body>
      <div class = "div1">TutorialsPoint.com</div></br>
      <div class = "div2">TutorialsPoint.com</div>
   </body>
</html>

CSS3 盒子測量屬性

現場演示

<html>
   <head>
      <style>
         .div1 {
            width: 300px;
            height: 100px;
            border: 1px solid blue;
            box-sizing: border-box;
         }
         .div2 {
            width: 300px;
            height: 100px;
            padding: 50px;
            border: 1px solid red;
            box-sizing: border-box;
         }
      </style>
   </head>
   <body>
      <div class = "div1">TutorialsPoint.com</div></br>
      <div class = "div2">TutorialsPoint.com</div>
   </body>
</html>

更新於: 20-Jun-2020

237 次瀏覽

開啟你的 職業 生涯

透過完成課程獲得認證

開始吧
廣告
© . All rights reserved.