उदाहरण
flexShrink प्रॉपर्टी से फ्लेक्स आइटम के सिकुड़ने की क्षमता सेट करें।
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: 1px solid #000000;
width: 500px;
height: 100px;
display: flex;
}
#box div {
flex-grow: 1;
flex-shrink: 1;
flex-basis: 300px;
}
</style>
</head>
<body>
<div id="box">
<div style="background-color:orange;">DIV1</div>
<div style="background-color:yellow;" id="myID">DIV2</div>
</div>
<p>flexShrink प्रॉपर्टी का उपयोग</p>
<button onclick="display()">सेट करें</button>
<script>
function display() {
document.getElementById("myID").style.flexShrink = "5";
}
</script>
</body>
</html>
व्याख्या: flex-shrink: 5 का अर्थ है यह आइटम अन्य आइटम्स की तुलना में 5 गुना अधिक सिकुड़ेगा जब स्थान कम हो। डिफ़ॉल्ट 1 है।