如何停止提交按钮上的背景颜色:buttonface?

6
我有一个提交按钮,已经进行了样式设置,在Safari,Chrome,Firefox和IE上看起来都正确,但是一旦我在iPad上查看该站点时,该输入按钮具有轻微的渐变效果,并且拥有圆角!
我不知道为什么这样做,当我右键单击它并检查其中的一些默认样式时(我没有应用它们),我看到。
input[type="button" i], input[type="submit" i], input[type="reset" i],         input[type="file" i]::-webkit-file-upload-button, button {
  align-items: flex-start;
  text-align: center;
  cursor: default;
  color: buttontext;
  padding: 2px 6px 3px;
  border: 2px outset buttonface;
  border-image-source: initial;
  border-image-slice: initial;
  border-image-width: initial;
  border-image-outset: initial;
  border-image-repeat: initial;
  background-color: buttonface;
  box-sizing: border-box;
  }

我猜测是background-color: buttonface;这个属性被应用到了它上面。我该如何停止这种情况呢?我只想要自己的纯色。
非常感谢您的帮助。

2
那么你设置的样式在哪里呢?ButtonFace是CSS2颜色名称,对应的HEX值为:#F0F0F0或RGB值为:240,240,240。-请参见- http://www.iangraham.org/books/xhtml1/appd/update-23feb2000.html - Paulie_D
2个回答

8

尝试在你的样式中添加-webkit-appearance: none;

浏览器会在表单元素中应用默认样式。使用上述代码可以删除它。


太棒了,谢谢@Bluety,第一次尝试就成功了,现在我可以看到自己的样式了,太酷了! - TF35Lightning
如果您要全局应用,请使用 none !important,否则它将被覆盖。 - Paul Razvan Berg

7

或者在特定元素上尝试使用以下CSS:

background-color: transparent;

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接