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

Problem in level 15 lesson 7 Flex Item flex-grow property?

unable to solve the task,

code

<!DOCTYPE html>
<html>
<head>
<title>CSS Flex Grow</title>
<style>
.flex-container{
background-color: #4535AA;
padding: 10px;
display: flex;
}
.flex-item{
background-color: white;
margin: 20px;
padding: 20px;

}

.bigger {
background-color: #FFB643;
flex-grow: 1;

}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">Item 1</div>
<div class="flex-item bigger">Item 2</div>
<div class="flex-item">Item 3</div>
<div class="flex-item">Item 4</div>
</div>
</body>
</html>
by

1 Answer

kshitijrana14
Try this one:

<!DOCTYPE html>
<html>
<head>
<title>CSS Flex Grow</title>
<style>
.flex-container{
background-color: #4535AA;
padding: 10px;
display: flex;

}
.flex-item{
background-color: white;
margin: 20px;
padding: 20px;
flex-grow:1;

}

.bigger {
background-color: #FFB643;
flex-grow:4;

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

Login / Signup to Answer the Question.