IOS forces rounded corners and highlights on inputs

iOS devices add a lot of annoying styles to form inputs, especially to [type = submit] input. The following are simple search forms on a desktop browser and on an iPad.

Desktop:

Desktop

IPad:

iPad

The input [type = text] uses the CSS shadow box insert, and I even specified -webkit-border-radius: none; which is apparently being redefined. The color and shape of my input button [type = submit] completely depreciate on the iPad. Does anyone know what I can do to fix this? Thanks in advance.

+89
css ios forms
Sep 29 2018-11-17T00:
source share
6 answers

In my version there was a version:

input { -webkit-appearance: none; } 

In some versions of the webkit browser, you may also find that border-radius is still in place. Reset with the following:

 input { -webkit-border-radius:0; border-radius:0; } 

This can be extended by applying the form webkite to all form components, such as input , select , button or textarea .

In relation to the original question, you will not use the value "none" when clearing the element based css element. Also keep in mind that this hides checkboxes in Chrome, so maybe use something like input[type=text] or input:not([type=checkbox]), input:not([type=radio]) instead input:not([type=checkbox]), input:not([type=radio])

+176
Oct 24 '11 at 17:04
source share

You can get rid of a few more forms of web whale, input, etc. with the help of this:

 input, textarea, select { -webkit-appearance: none; } 
+17
Feb 07 '13 at 18:30
source share

For the submit button, do not use:

 <input type="submit" class="yourstylehere" value="submit" /> 

Use the button tag instead:

 <button type="submit" class="yourstylehere">Submit</button> 

It worked for me.

+4
Apr 03 '12 at 11:50
source share

look normalize.css

There is a demo where you can test form elements and see how they look in ios. There are several web kit oriented properties.

+1
18 Oct '11 at 10:36
source share

This is what I use in my projects.

 * { -webkit-tap-highlight-color: transparent; } a, article, div, h1, h2, h3, h4, h5, h6, img, section, span { -moz-user-select: none; -webkit-user-select: none; } input, select, textarea { -webkit-appearance: none; -webkit-border-radius:0; border-radius: 0; } 
+1
Feb 16 '14 at 16:27
source share

You also get this problem in some browsers if you have the following:

 <a class="btn btn-primary" href="#" type="button">Link</a> 

instead:

 <a class="btn btn-primary" href="#" role="button">Link</a> 

This can happen if you change your input element to anker element and forget to change type to role .

I had this problem on Chrome and Safari on my iPad.

0
May 23 '19 at 9:02
source share



All Articles