首页 > 解决方案 > 为什么 chrome 会覆盖 -webkit-appearance Css 属性?

问题描述

我有这个CSS:

a#exampleId {
    -webkit-appearance: button;
   /* -moz-appearance: button;*/
appearance: button;
}

这个HTML:

<html itemscope="" itemtype="http://schema.org/WebPage" lang="en" wtx-context="7AFAB2C8-5844-4EA0-8DF4-32D617786BAD">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <link rel="stylesheet" href="example.css">
</head>

<body>
    <form>
        <p>TEXT <a id="exampleId" href="google.com">click this </a></p>
        <button> A </button>
    </form>
<body>
</html>

在 chrome 中,我看到浏览器覆盖了 -webkit-appearance: 按钮;财产:

在此处输入图像描述

为什么 chrome 会覆盖 -webkit-appearance 属性以及如何防止它?

标签: htmlcssgoogle-chrome

解决方案


带有供应商前缀的属性名称是实验性功能,通常不用于生产用途。

当它们停止实验时,前缀被删除,一个无前缀的版本取代它。

-webkit-appearanceappearance稍后被两行覆盖。


推荐阅读