Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

CSS max-height Property - กำหนดความสูงสูงสุด

คุณสมบัติ max-height ใช้กำหนดความสูงสูงสุดที่ Box สามารถมีได้ ค่าเป็นตัวเลข, ความยาว, หรือเปอร์เซ็นต์

ตัวอย่าง

<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
    </p>
    <br><br><br>
    <img alt="logo" src="/css/images/logo.png" width="210" height="100" />
</body>
</html>

หมายเหตุ: เนื้อหาที่เกินความสูงจะถูกตัดทิ้งหรือล้นออกมาตามค่า overflow