首頁  >  文章  >  web前端  >  使用 CSS 設定框的最大寬度

使用 CSS 設定框的最大寬度

PHPz
PHPz轉載
2023-09-01 15:45:07656瀏覽

使用 CSS 设置框的最大宽度

max-width屬性用來設定一個盒子的最大寬度。 max-width屬性的值可以是一個數字、長度或百分比。

範例

<html>
   <head>
   </head>
   <body>
      <p style = "max-width:100px; height:200px; border:1px solid green; padding:5px; margin:10px;">
         This paragraph is 200px high and max width is 100px
         This paragraph is 200px high and max width is 100px
      </p>
      <img alt = "logo" src = "/css/images/logo.png" width = "100" height = "100" />
   </body>
</html>
#

以上是使用 CSS 設定框的最大寬度的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除