设置CSS可以容纳盒子的最大高度
在最大高度属性是用来设置一个最大高度,一个箱子即可。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>