Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<h2>Not wrapped</h2>
<div class="container">
    <div class="text">text</div>
    <button>button</button>
</div>
<h2>Wrapped</h2>
<p>When the flex item is forced to wrap, we want it to grow, but not before it wraps.</p>
<div class="wrapper">
    <div class="container">
        <div class="text">text</div>
        <button>button</button>
    </div>
</div>
</body>
</html>
 
.container {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid;
}
.text {
    flex-grow: 1;
    flex-basis: 300px;
    border: 1px solid;
}
button {
    border: 1px solid;
}
.wrapper {
    width: 200px;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
OliverJAshpro
0viewers