使用 CSS 设置框的最大高度
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>