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的max-width屬性的詳細內容。更多資訊請關注PHP中文網其他相關文章!