I make up a search form of this kind.

alt text

I can’t set up the location of the "search" button: in all browsers, it turns out to be located differently http://jsfiddle.net/T33sw/5/ . Tell me, how can I adjust the location of the button?

    1 answer 1

    Heidel, I do as follows:

    <div class="search> <input type="text" ....> <button></button> </div> .search{ position: relative; padding: 0 20px 0 0; /* 20px это ширина кнопки поиска, можно сделать побольше что бы текст не был вплотную к кнопке поиска*/ ... } .search input{ width: 100%; ... } .search button{ position: absolute; top: 0; right: 0; width: 20px; background: url('...'); .... } 

    I hope the meaning is clear

    • Well, as I understand it, did you specify absolute positioning for the button? or something else? - Heidel
    • one
      Yes. But this solution is convenient because the text does not fit the button, as the solution is near. And the field width is 100%, i.e. the width of everything can be adjusted via .search. And since the button is absolutely positioned, you don’t have to steam about the vertical-align of two adjacent inline elements - psycho_Octopus
    • Yes, of course, thank you very much)) - Heidel