CSS - ความกว้างขั้นต่ำ

คำอธิบาย

นาทีความกว้างของคุณสมบัติที่จะใช้ในการตั้งค่าที่ถูกผูกไว้ที่ต่ำกว่าความกว้างของธาตุนั้น

ค่าที่เป็นไปได้

  • length- หน่วยความยาวใดก็ได้ องค์ประกอบไม่สามารถมีค่าสำหรับความกว้างที่น้อยกว่าระยะนี้

  • percentage - จำกัดความกว้างขององค์ประกอบเป็นอย่างน้อยร้อยละนี้ของความกว้างของบล็อกที่มี

นำไปใช้กับ

องค์ประกอบ HTML ทั้งหมดยกเว้นองค์ประกอบแบบอินไลน์และองค์ประกอบตารางที่ไม่ถูกแทนที่

ไวยากรณ์ DOM

object.style.minWidth = "50px"

ตัวอย่าง

นี่คือตัวอย่าง -

<html>
   <head>
   </head>

   <body>
      <p style = "min-width:400px; height:100px; border:1px solid red; padding:5px; margin:10px;">
         This paragraph is 100px high and min width is 400px
         This paragraph is 100px high and min width is 400px
         This paragraph is 100px high and min width is 400px
         This paragraph is 100px high and min width is 400px
         This paragraph is 100px high and min width is 400px
      </p>
      
      <img alt = "logo" src = "/css/images/logo.png" width = "95" height = "84" />
   </body>
</html>

สิ่งนี้จะให้ผลลัพธ์ดังต่อไปนี้ -


CSS ตอบสนอง

Language