Microsoft Edge浏览器无法正确呈现双'box-shadow inset'

问题描述 投票:0回答:1

请参见下面使用两个box-shadow: inset作为下划线的文本的示例片段。

它可以完美地在Chrome,Firefox和Safari(最新版本)上呈现。

enter image description here

但是在Edge上看起来像这样(请看下划线底部的褪色线泄漏):

enter image description here

问题

有什么解决方法吗?还是我应该给Edge用户应得的东西?

@import url('https://fonts.googleapis.com/css?family=Proxima+Nova');

h2 {
  font-family: 'Proxima Nova';
  color: rgb(60,128,124);
  font-size: 21px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 10px;
}

a.boxShadow {
  color: darkGrey;
  text-decoration: none;  
  line-height: 26px;
  
  box-shadow: inset 0 -2px white, inset 0 -4px 0 rgb(60,128,124);
  padding-bottom: 3px;
}
<h2>
  <a class="boxShadow">Hello gjq box-shadow</a>
</h2>

enter image description here

https://gs.statcounter.com/browser-market-share/all/europe/#monthly-201810-201910-bar

css microsoft-edge box-shadow
1个回答
1
投票

我在Microsoft Edge(EdgeHTML)中转载了该问题。我认为这可能是由于不同浏览器的渲染引擎的性能不同所致。此外,我发现了类似的issue report,您也可以报告此问题。 another issue report的情况也类似。

您可以尝试避免在Microsoft Edge(EdgeHTML)中使用两个插入框阴影,并使用以下代码作为解决方法:

@import url('https://fonts.googleapis.com/css?family=Proxima+Nova');
h2 {
  font-family: 'Proxima Nova';
  color: rgb(60, 128, 124);
  font-size: 21px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 10px;
}

.boxShadow {
  color: darkGrey;
  text-decoration: none;
  line-height: 26px;
  box-shadow: inset 0 -2px 0 rgb(60, 128, 124);
  padding-bottom: 1px;
}
<h2>
  <a class="boxShadow">Hello gjq box-shadow</a>
</h2>
© www.soinside.com 2019 - 2024. All rights reserved.