ios 阻止 Safari Mobile 为输入按钮提供圆角

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5263260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:11:11  来源:igfitidea点击:

Stop Safari Mobile from giving input buttons rounded corners

iosmobile-safari

提问by Newbie Fletcher

I guess the subject says it all. I have a web application when viewed on an Iphone, Ipod or Ipad, input submit buttons have rounded corners. Is there a way to stop this?

我想这个主题说明了一切。在 Iphone、Ipod 或 Ipad 上查看时,我有一个 Web 应用程序,输入提交按钮有圆角。有没有办法阻止这种情况?

回答by methodofaction

If you add...

如果添加...

input, textarea {
  -webkit-appearance: none;
  border-radius: 0;
}

Then your buttons will inherit any CSS styles that you have applied for other browsers.

然后您的按钮将继承您已应用于其他浏览器的任何 CSS 样式。

回答by Roel

Didn't work for me, the -webkit-appearance:none.

-webkit-appearance:none 对我不起作用。

This does:

这样做:

input[type=submit] {
    -webkit-border-radius:0px;
}

I had the same issue with rounded corners on a button with background image, just on the iPhone.

我在带有背景图像的按钮上的圆角方面遇到了同样的问题,就在 iPhone 上。

回答by dthukka

You can try to use following CSS:

您可以尝试使用以下 CSS:

-webkit-appearance:none;

More info: http://trentwalton.com/2010/07/14/css-webkit-appearance/

更多信息:http: //trentwalton.com/2010/07/14/css-webkit-appearance/

回答by Daniele F.

I've found that on iPad 2 you have to use the following:

我发现在 iPad 2 上你必须使用以下内容:

-webkit-appearance:none;
border-radius: 0;

in your button class.

在您的按钮类中。

回答by RevConcept

I had a site with an input submit type="image". This vairation of the above fixed the rounded corners:

我有一个输入提交类型=“图像”的网站。上面的这种变化固定了圆角:

input[type=image] {
    -webkit-border-radius:0px;
}

回答by mait

I've found that setting background: linear-gradient(color1, color2)gets rid of the overly rounded corners on Apple devices and works on all other browsers/platforms I have tried.

我发现该设置background: linear-gradient(color1, color2)消除了 Apple 设备上过于圆角的问题,并且适用于我尝试过的所有其他浏览器/平台。