1
I have the code below:
.segura{
width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
.label{
width: 90px;
height: 20px;;
float: left;
background-color: #6fccdd;
}
.campo{
width: calc(100% - 90px);
height: 20px;
float: left;
background-color: #999999;
border: solid 0px transparent;
padding: 0px;
}
<div class="segura">
<label class="label">nome</label>
<input value="" type="text" class="campo">
</div>
If I set a width for the LABEL, it works, but how to do the same effect by putting width: auto; for the LABEL and the FIELD fill all the remaining space?
Cara I didn’t understand what you want to do... the label already has a size and the input already occupies the rest.... what you are intending to do, or what behavior you want to do with respect to width, it is not clear
– hugocsl
They already answered what I needed, but answering their question: I want to be able to put width: auto; no label, because each label will have a different word (name, email, message, etc..)
– caiocafardo