Chrome中的链接类型为“提交”的边框没有消失吗?

时间:2018-11-04 19:54:04

标签: html css google-chrome

全部。在弄清楚铬是我的问题之前,我已经花了几个小时研究应该非常简单的内容。本质上,我试图格式化“提交”类型的链接,以使其不再像按钮。我的CSS是:

a[type="submit"]:link,
a[type="submit"]:focus,
a[type="submit"]:visited,
a[type="submit"]:active {
  background: #fff;
  border: 0 !important;
  cursor: pointer;
  outline: none!important;
  display: block;
  padding: 0;
  margin: 0 auto;
  text-decoration: none;
  width: 100%;
  height: 100%;
}
<a href="#" name="set" type="submit" value="set">Text</a>

奇怪的是,在此代码段中看起来不错。但是,当我在项目中运行此控件时,chrome不会删除将类型设置为“提交”时出现的链接周围的边框。它确实成功将背景色更改为白色。在Firefox中打开时,一切看起来不错。有什么办法可以解决这个问题?

1 个答案:

答案 0 :(得分:0)

您似乎在anchorbutton之间感到困惑

:visited:link是CSS伪类,通常用于设计锚元素的样式。

type="submit"用于按钮元素。虽然可以在锚元素上设置type ,但它只会...

  

以MIME类型的形式为链接的URL指定媒体类型。它纯粹是建议性的,没有内置功能。<​​/ p>

button[type="submit"],
button[type="submit"]:focus,
button[type="submit"]:active {
  background: #fff;
  border: 0 !important;
  cursor: pointer;
  outline: none!important;
  display: block;
  padding: 0;
  margin: 0 auto;
  text-decoration: none;
  width: 100%;
  height: 100%;
}
<button name="set" type="submit" value="set">Text</button>