Leonardo, although there is not a single correct way to make a responsive Designer, what we can do is share our personal practice.
In my case, I don’t usually set a size for the inputs, but for the div that contains the input, label, etc.
The second point is to set a minimum size for the form/div that contains all inputs, in my case I set a minimum size of 320px, but this is up to you. Another interpresante point, a set a maximum size for the form/div.
I particularly prefer to work with the concept of Mobile-First, first I define my rules for small screens, then I adapt the layout for large screens.
.linha {
clear: both;
min-width: 320px;
max-width: 65em;
position: relative;
right: 0px;
left: 0px;
margin: auto;
}
.coluna {
float: left;
}
.coluna label,
.coluna input {
width: 100%;
}
.coluna label:after {
content: ':'
}
@media only screen {
.pequeno-12 {
width: 100%;
}
}
@media only screen and (min-width: 40em) {
.coluna label {
float: right;
text-align: right;
margin-top: 2px;
margin-right: 5px;
}
.mediano-4 {
width: 33.33333%;
}
.mediano-8 {
width: 66.66667%;
}
}
@media only screen and (min-width: 65em) {
.grande-2 {
width: 16.66667%;
}
.grande-4 {
width: 33.33333%;
}
}
<form>
<div class="linha">
<div class="coluna pequeno-12 mediano-4 grande-2">
<label for="cmpA">Nome da Empresa</label>
</div>
<div class="coluna pequeno-12 mediano-8 grande-4">
<input id="cmpA" type="text" name="empnome" maxlength=80/>
</div>
<div class="coluna pequeno-12 mediano-4 grande-2">
<label for="cmpB">Criada Em</label>
</div>
<div class="coluna pequeno-12 mediano-8 grande-4">
<input id="cmpB" type="date" name="data" maxlength=10/>
</div>
</div>
<div class="linha">
<div class="coluna pequeno-12 mediano-4 grande-2">
<label for="cmpC">Responsavel</label>
</div>
<div class="coluna pequeno-12 mediano-8 grande-4">
<input id="cmpC" type="text" name="empnome" maxlength=80/>
</div>
<div class="coluna pequeno-12 mediano-4 grande-2">
<label for="cmpD">Ultima Vistoria</label>
</div>
<div class="coluna pequeno-12 mediano-8 grande-4">
<input id="cmpD" type="date" name="data" maxlength=10/>
</div>
</div>
</form>
From what I understand, just define the property
min-width
in hisinput
.– Renan Gomes