Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

CSS LEVEL 15 LESSON 8

Flex-shrink not working
by

2 Answers

sayant8szo
.flex-item{
margin: 3px;
padding: 20px;
background-color: white;
width: 150px;
flex-shrink: 1;



}
.shrink{

flex-shrink: 5;

}

</style>
</head>
<body>
<div class="flex-container">
<div class="shrink">Item 1</div>
<div class="flex-item">Item 2</div>
<div class="flex-item">Item 3</div>
</div>
sipho
<!doctype html>
<html>
<head>
<title>CSS Flex Shrink</title>
<style>
.flex-container{
display: flex;
background-color: #4535AA;
}
.flex-item{
flex-shrink: 1;
margin: 3px;
padding: 20px;
background-color: white;
width: 150px;

}

.flex-item shrink{
flex-shrink: 5;
}

</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item shrink">Item 1</div>
<div class="flex-item">Item 2</div>
<div class="flex-item">Item 3</div>
</div>
</body>
</html>

Login / Signup to Answer the Question.