Chrome浏览器在Windows系统上显示的CSS工具提示模糊

3

我个人无法复现这个问题,但是一个用户在工具提示中看到文字模糊。她在一台现代化的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。 我应该在哪里修改代码,以使得这些用户不受影响?

1
可以确认在最新的Chrome浏览器上我看到了它。 - CalvT
1
问题在于Windows试图显示该字体。我想这个字体是为视网膜Mac设计的,那里有2倍的像素数量。你唯一的选择就是增加字体大小或更改字体。PS:Firefox只稍微更易读一些。 - CalvT
啊,这很有道理。这个网站(http://www.cssfontstack.com)说Windows只支持Gill Sans 58%。改变字体可以解决这个问题吗?我很沮丧,看不到! - Kimberly-Ann
1
请查看以下链接:http://i.stack.imgur.com/vteQu.jpg、http://i.stack.imgur.com/azI3R.jpg 和 http://i.stack.imgur.com/KlsdS.jpg。 - CalvT
好的,很酷,我会尝试切换到Arial字体,非常感谢! - Kimberly-Ann
2个回答

0

CalvT 一语中的 - 我把字体改成Arial,问题就解决了。


0

是的,更改字体家族确实有效,只需将此行粘贴到您的CSS中,问题就解决了。

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

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