I have a simple search form:
<div class="search"> <input placeholder="Search term here"> <button> Go </button> </div>
Naturally, the button goes to the right of the entrance. However, on mobile devices, I want to reverse this - so that the button is on the left.
For this, I created:
.search { width: 100%; } input { float: right; width: 100%; height: 30px; } button { float: left; width: 30px; height: 30px; }
https://jsfiddle.net/ufLoj5se/5/
But of course, this presses a button on the second line.
Is there a way to nullify the 30x width of the button from the input so that the button sits tight to the left?
html css
Meltingdog
source share