I have an element .els with div .number (fixed width) and input .things. I want .els to be responsive. Width should be dependent on the screen. But when i test it in responsive mode in browser, .els have the same width all the time, no matter what. I think it's a problem of input. I read every thread in stackoverflow.com, I've tried everything and nothing works.
https://jsfiddle.net/bugs55/qtdLxv5o/15/
#elements {
overflow: auto;
background: #1d1e2e;
}
#elements .els {
margin: 0 auto 10px auto;
overflow: auto;
box-sizing: border-box;
padding: 10px;
border-radius: 15px;
width: 400px;
display: flex;
}
#elements .els .number,
#elements .els input {
float: left;
}
#elements .els .number {
font-size: 20px;
color: #dedede;
width: 25px;
height: 25px;
padding: 5px;
border-radius: 100px;
line-height: 25px;
margin: 0 10px 0 5px;
background: rgba(0, 0, 0, 0.25);
}
#elements .els input {
line-height: 29px;
flex: 1;
min-width: 0;
box-sizing: border-box;
border: none;
background-image: none;
background-color: transparent;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
padding: 3px 0 1px 0;
font-size: 20px;
color: #dedede;
}
#elements .els .clear {
clear: both;
display: none;
}
@media only screen and (max-width: 430px) {
.els {
width: 100%;
}
.els:focus-within,
.els:hover {
transition: none;
width: 0;
}
}
<div id="elements">
<div class="els" style="background:#00bfff">
<div class="number" style="">1</div>
<input type="text" class="things">
<div class="clear"></div>
</div>
</div>