max-height屬性用來設定一個盒子的最大高度。 max-height屬性的值可以是一個數字、一個長度或一個百分比。
<html> <head> </head> <body> <p style = "width:400px; max-height:10px; border:2px solid green; padding:10px; margin:15px;"> This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px This paragraph is 400px wide and max height is 10px </p> <br> <br> <br> <img alt = "logo" src = "/css/images/logo.png" width = "210" height = "100" /> </body> </html>
以上是使用 CSS 設定方塊的最大高度的詳細內容。更多資訊請關注PHP中文網其他相關文章!