I am trying to achieve a specific look of responsive search bar where I display search input, select option for filters and submit button in one row. Submit button and select have defined widths of 44px and 110px respectively and I want search input field to occupy rest of available space, therefore I use width: calc(100% - 154px);
. But it is not working as intended. Please see example here https://jsfiddle.net/t97fqqxu/
HTML:
<div id="main-search">
<form>
<input type="text" placeholder="Search.." />
<select>
<option>Option</option>
</select>
<input type="submit" value="Submit"/>
</form>
</div>
CSS
#main-search {
background-color: @palette-white;
}
#main-search form {
width: 100%;
background: green;
}
#main-search input[type="text"] {
width: calc(100% - 154px);
}
#main-search select {
width: 110px;
}
#main-search input[type="submit"] {
text-indent: -9999px;
width: 44px;
height: 44px;
}
EDIT: I'm taking advantage of bootstrap 3's box-model, thus no mater margins and paddings, widths will always be 44px and 110px