【问题标题】:Blurry CSS tooltips on Chrome on WindowsWindows 上 Chrome 上的模糊 CSS 工具提示
【发布时间】:2016-06-08 18:50:00
【问题描述】:

我个人无法重现该问题,但用户看到工具提示中的文本模糊不清。她正在一台现代 Windows 机器上运行最新版本的 Chrome。她说,连文字内容都很难辨认。

/* The question mark that the user clicks on */
.tooltip_wrapper {
  font-size: 14px;
  display: inline-block;
  margin-left: 10px;
  padding: 0 10px;
  background: #ececec;
  color: #555;
  cursor: help;
  font-family: "Gill Sans", Impact, sans-serif;
  position: relative;
  text-align: center;
  -webkit-transform: translateZ(0); /* WebKit flicker fix */
  -webkit-font-smoothing: antialiased; /* WebKit text rendering fix */
    z-index: 900;
}

.tooltip_wrapper .tooltip {
  background: #1496bb;
  bottom: 100%;
  color: #fff;
  display: block;
  left: -25px;
  margin-bottom: 15px;
  opacity: 0; /* This hides the box when not hovering */
  padding: 20px;
  pointer-events: none;
  position: absolute;
  width: 400px;
  -webkit-transform: translate(10px);
     -moz-transform: translate(10px);
      -ms-transform: translate(10px);
       -o-transform: translate(10px);
          transform: translate(10px);
/* These used to be all translateY */
  -webkit-transition: all .25s ease-out;
     -moz-transition: all .25s ease-out;
      -ms-transition: all .25s ease-out;
       -o-transition: all .25s ease-out;
          transition: all .25s ease-out;
  /* -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
     -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
      -ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
       -o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
          box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28); */
}

/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.tooltip_wrapper .tooltip:before {
  bottom: -20px;
  content: " ";
  display: block;
  height: 20px;
  left: 0;
  position: absolute;
  width: 100%;
}

/* CSS Triangles - see Trevor's post */
.tooltip_wrapper .tooltip:after {
  border-left: solid transparent 10px;
  border-right: solid transparent 10px;
  border-top: solid #1496bb 10px;
  bottom: -10px;
  content: " ";
  height: 0;
  right: 88%;
  margin-left: -13px;
  position: absolute;
  width: 0;
}

.tooltip_wrapper:hover .tooltip {
  opacity: 1;
  pointer-events: auto;
  -webkit-transform: translate(0px);
     -moz-transform: translate(0px);
      -ms-transform: translate(0px);
       -o-transform: translate(0px);
          transform: translate(0px);
/* These used to be all translateY */
}

/* Internet Explorer can just show/hide with no transition */
.lte8 .tooltip_wrapper .tooltip {
  display: none;
}
.lte8 .tooltip_wrapper:hover .tooltip {
  display: block;
}
<h1>
Some header to create space
</h1>

<div class='tooltip_wrapper'>?<div class='tooltip'>This is the tooltip text</div></div>

我也在那个网站上设置了一个 JSFiddle,https://jsfiddle.net/rsnbtph7/#&togetherjs=xDN35iPAvV

我应该在哪里调整代码,以免这些用户处于不利地位?!

【问题讨论】:

  • 可以在我看到的最新 chrome 上确认
  • 问题是窗口试图显示字体。我想这种字体是为视网膜 Mac 设计的,它的像素数量是 2 倍。您唯一的选择是增加字体大小或更改字体。 PS:Firefox 的可读性略高一些
  • 啊,这很有道理,这个网站 (cssfontstack.com) 说 windows 只支持 58% 的 Gill Sans。换字体能治好吗?我很沮丧看不到!
  • 好吧,我试试换成 Arial,非常感谢!

标签: css google-chrome tooltip


【解决方案1】:

CalvT 合而为一 - 我将字体更改为 Arial,现在问题已经解决了。

【讨论】:

    【解决方案2】:

    是的,更改字体系列确实有效,只需将此行粘贴到您的 css 中即可。

    .tooltip {
       font-family: Arial,sans-serif !important;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-01
      • 2017-06-16
      • 2020-03-28
      • 1970-01-01
      • 1970-01-01
      • 2014-05-04
      • 2018-01-15
      • 1970-01-01
      相关资源
      最近更新 更多