Tag Archives: Style input element to fill remaining width of its container

Style input element to fill remaining width of its container

Question Let’s say I have an html snippet like this: <div style=”width:300px;”> <label for=”MyInput”>label text</label> <input type=”text” id=”MyInput” /> </div> This isn’t my exact code, but the important thing is there’s a label and a text input on the same line in a fixed-width container. How can I style the input to fill the remaining… Read More »