Vertically central input field

I have a text input box on the page, however, it’s difficult for me to try to vertically center the box in webkit (Chrome + Safari). This is great in Firefox.

Here is the code:

<form action="/" method="get">
    <input type="text" name="s" id="search" class="search" size ="34" value="Search..." onblur="if(this.value == ''){ this.value = 'Search...'; this.style.color = '#BBB';}" onfocus="if(this.value == 'Search...'){ this.value = ''; this.style.color = '#000';}" />
    <input class="schbtn"ntype="submit" value="" />
</form>

And CSS:

.schbtn {background:url(/wp-content/themes/shamil/images/search_icon.png) no-repeat scroll 50% 50% #7BA60D;height:26px; width:26px;}
#navtabs li.rnavtab input{border:0;padding-left:5px;color:#BBB;}

These are only two that affect him.

For those who want to see this in action, visit http://shamil.la and watch the search box in both Firefox and Safari / Chrome. It made my head climb the wall.

thank

+3
source share
1 answer

Place a vertical-align:middle;on both input elements and center it

+3
source

All Articles