iphone overriding all of my styles on an input[type="submit"]
Asked Answered
H

2

6

I have isolated my input[type="submit"] in this JSFIDDLE.

The code as well,

input[type="submit"] {
    width: 100%;
    height: 40px;
    background: #FFD100;
    border-radius: 5px;
    box-shadow: 0 5px 0 #A58B1E;
    border: none;
    font-size: 20px;
    color: #2b2b2b;
    cursor: pointer;
    position: relative;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

input[type="submit"]:active, input[type="submit"]:focus {
    box-shadow: 0 3px 0 #A58B1E;
    top: 2px;
    outline: none;
}

Everything look great except, when I checked the site on my iphone. Since my client wanted a responsive website I figured this button I made would look great on every device.

Oh boy, I was so wrong because on my iphone the button is truly hideous. I am including an image to what the mobile view looks like and the url to the site.

Any ideas why this is happening or how I can override it?


(Chatfield Drilling Live Site)

Submit button problem

Harmonicon answered 17/12, 2013 at 16:58 Comment(1)
possible duplicate of css styling for input buttons on ipad / iphoneAdmonish
R
15

You might be looking for:

-webkit-appearance: none;
Rhumb answered 17/12, 2013 at 17:1 Comment(4)
Hmm that seemed to do the trick. Should I do this for every input I have? They all seem to display my styles just fine.Harmonicon
I first came accross this when i was in need of a fix: trentwalton.com/2010/07/14/css-webkit-appearance - very useful to know - you can apply where you see fitRhumb
.. also forgot to answer, yes you can use it on inputs / textareasRhumb
Very interesting! Thank you so much for the article and I'm glad it was a easy fix. :]Harmonicon
P
4

You need to use -webkit-appearance:none in your button.

Also, if you have round corners at input fields you can use the following CSS:

input {
    -webkit-border-radius:0; 
}
Piatt answered 17/12, 2013 at 17:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.