Take the 2-minute tour ×

I am implementing a search box for a html-javascript based app using Chrome:


it should look like this:

enter image description here

but when I deploy app on iphone, screen looks like this:

enter image description here

I know it's difference with webkit, I thought using safari to debug it would be a solution, however,when I use safari to open it, it looks like this:

enter image description here

Just don't know why on iPhone, it looks like that. How to improve it to the feature which I need?

Here is the html:

<div class="form-wrapper">
    <input type="text" placeholder="Search here..." required>


.form-wrapper {
    height: 80px;
    background: #555;
    color: #FFF;
    clear: both;
.form-wrapper input {
    background-color: #FFF;
    -moz-box-sizing: border-box;
    border-radius: 10px;
    border: 5px solid #E5E4E2;
    margin: 2px;
    height: 40px;
    vertical-align: middle;
    padding: 20px;
    margin-top: 15px;
    width: 85%;
.form-wrapper button {
    overflow: visible;
    position: absolute;
    float: right;
    border: 0;
    padding: 0;
    cursor: pointer;
    height: 40px;
    width: 110px;
    color: #FFF;
    text-transform: uppercase;
    background: red;
    border-radius: 0 3px 3px 0;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
    margin: 20px -116px;
.form-wrapper button:before {
    position: absolute;
    border-width: 8px 8px 8px 0;
    border-style: solid solid solid none;
    border-color: transparent red transparent;
    top: 12px;
    left: -6px;
share|improve this question
add comment

1 Answer

type="search" causes the field to have a -webkit-appearance: searchfield on Safari, which causes lots of your styles to be ignored.

Have either a none appearance or textfield appearance. Here is a fiddle with none, which seems to work for me on Safari 6/OSX (no iDevice available to test).

share|improve this answer
add comment

Your Answer


