I have a parent container with fixed length. It has two children: span and select. There's a problem that select overflows parent when option name is very long.
I would like the select to not grow past parent width.
Here's a codepen: https://codepen.io/dostu/pen/eYrPKjZ
EDIT: The select options are dynamic in my case. When they are short I would like to keep the select's original width and not fill the parent 100%.
.container {
display: flex;
align-items: center;
width: 150px;
height: 50px;
background-color: #ddd;
}
<div class="container">
<span>Style</span>
<select>
<option>Very very very long option</option>
</select>
</div>