On iOS (Safari 5) I have to following for input element (top inner shadow):
I want to remove top shadow, bug -webkit-appearance
doesn't save.
Current style is:
input {
border-radius: 15px;
border: 1px dashed #BBB;
padding: 10px;
line-height: 20px;
text-align: center;
background: transparent;
outline: none;
-webkit-appearance: none;
-moz-appearance: none;
}
You'll need to use
-webkit-appearance: none;
to override the default IOS styles. However, selecting just theinput
tag in CSS will not override the default IOS styles, because IOS adds it's styles by using an attribute selectorinput[type=text]
. Therefore your CSS will need to use an attribute selector to override the default IOS CSS styles that have been pre-set.Try this:
Helpful Links:
You can learn more about
appearance
here:http://css-tricks.com/almanac/properties/a/appearance/
If you'd like to learn more about CSS attribute selectors, you can find a very informative article here:
http://css-tricks.com/attribute-selectors/
This works better for me. Plus it means I don't have to apply it to every different type of input (i.e. text, tel, email, etc).
Seems to remove the shadows as well.
As @davidpauljunior mentioned; be careful setting
-webkit-appearance
on a general input selector.webkit will remove all properties
Try using the property box-shadow to remove the shadow on your input element