สไตล์minคุณสมบัติ ความสูง
ตัวอย่าง
กำหนดความสูงขั้นต่ำของ <div> องค์ประกอบ:
document.getElementById("myDIV").style.minHeight = "100px";
ความหมายและการใช้งาน
คุณสมบัติ minHeight ตั้งค่าหรือส่งคืนความสูงขั้นต่ำขององค์ประกอบ
คุณสมบัติ minHeight มีผลเฉพาะกับองค์ประกอบระดับบล็อกหรือองค์ประกอบที่มีตำแหน่งที่แน่นอนหรือคงที่
เคล็ดลับ:หากต้องการตั้งค่าหรือคืนค่าความสูงสูงสุดขององค์ประกอบ ให้ใช้คุณสมบัติmaxHeight
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
minHeight | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ minHeight:
object.style.minHeight
ตั้งค่าคุณสมบัติ minHeight:
object.style.minHeight = "length|%|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
length | Defines the minimum height in length units. Default is 0 |
% | Defines the minimum height in % of the parent element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | 0 |
---|---|
คืนมูลค่า: | สตริง แทนความสูงขั้นต่ำขององค์ประกอบ |
เวอร์ชัน CSS | CSS2 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
ส่งกลับความสูงขั้นต่ำของ <div> องค์ประกอบ:
alert(document.getElementById("myDiv").style.minHeight);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Dimension
การอ้างอิง CSS: คุณสมบัติความสูงต่ำสุด
❮ สไตล์วัตถุ