I'm trying to make the input
and its container div
from the following HTML to take the remaining available width (fiddle provided):
<div id="container">
<div id="information">
<div id="leftcontainer"><lable>Field name:</lable></div>
<div id="rightcontainer">
<div id="action">A</div>
<div id="textdiv">
<input type="text" style="width:100%;" value="something"/>
</div>
</div>
</div>
<div id="additional">Additional info</div>
</div>
And the relevant part of the CSS:
#container, #information, #additional{
width:600px;
}
#leftcontainer{
float: left;
width: 30%;
display:inline-block;
position: absolute;
top: 5%;
}
#rightcontainer{
float:right;
width:67%;
display:inline-block;
}
#action{
float:right;
width:40px;
height:40px;
text-align:center;
}
#textdiv {
width:100%;
height:100%;
}
This does not work properly as the input slides under the #action
div and takes up the entire 67% of it's parent. I've looked and tried the solutions described here and here but the result did not improve. How can I make the input
take up the available width in this situation? (Some pointers on how to "fix" the label
, although not mandatory, are very much appreciated.)