IE8 字体大小切换为 :hover - 仅限日语

发布于 2025-01-08 01:18:42 字数 295 浏览 1 评论 0原文

我有一个多语言页面,但仅对日语版本有问题。

由于某些原因,在 IE8 中,当我将鼠标悬停在某个元素上时,同级元素的字体大小将会增加/减小。

更奇怪的是,这种情况并不是每次悬停都会发生,有时我无法立即重现,我需要继续将鼠标悬停在页面同一区域的不同元素上。最终这个错误将露出它丑陋的头。

这个bug只出现在日语页面,其他语言似乎都没问题。

这可能会发生在其他版本的 Internet Explorer 上,我尚未在所有版本上进行测试。

澄清一下,我没有对任何 :hover 规则进行任何字体大小更改。

I have a page that is multi lingual and I have an issue with the Japanese version only.

For some reason in IE8, when I hover over an element, a sibling's font-size will increase/decrease.

Even stranger, is that this doesn't happen on every hover, sometimes I cannot reproduce straight away, I need to keep hovering over different elements in the same area of the page. Eventually this bug will rear its ugly head.

This bug only occurs on the Japanese page, all other languages seem to be fine.

This could be happening on other versions of Internet explorer, I haven't tested on all.

To clarify, I have not got any font-size changes on any :hover rules.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

巴黎盛开的樱花 2025-01-15 01:18:42

我在一家日本网站工作,最近遇到了这个问题。在花费了超出合理时间的时间后,我从这些详细的日语文章中找到了答案:

顶部链接包含处理它的方法。对于那些看不懂日语的人,我将总结一下:


该问题仅影响 IE8 显示使用 MS P Gothic 字体(通常是 Windows 上的默认日语字体)且字体大小在 9px 之间的页面和 11 像素。与许多 IE bug 不同,它与浮动/边距/行高/等无关。正如 Oldie 指出的那样,该错误并不一致,有时会立即发生,有时需要悬停几次,而且似乎会随机放大/缩小文本。

三个主要解决方案如下

  1. 将字体设置为 MS Gothic 或使用 font-family 样式的其他日语字体。
  2. 将字体大小更改为 9px ~ 11px 范围之外的任何内容(在默认 IE8 字体设置下,1em 大小的文本不会受到影响,但稍小的文本(例如,0.8em)将会受到影响)。
  3. 通过在标题中添加以下内容,强制 IE8 像 IE7 一样显示页面:
    < /code>

我选择了 #2,因为 MS Gothic 与所有其他 MS P Gothic 文本相比看起来很不和谐,并且觉得 #3 对我们的网站有明显的缺点。

这不是一个理想的解决方案,但它确实有效。祝你好运。

I work for a Japanese site and recently came across this issue. After spending more time than was reasonable, I found the answer from these detailed write-ups in Japanese:

The top link includes the ways to deal with it. For those who can't read Japanese I will summarize:


The problem only affects IE8 showing pages using the MS P Gothic font (generally the default Japanese font on Windows) at a font-size that is between 9px and 11px. Unlike many IE bugs, it has nothing to do with floats/margins/line-height/etc. As Oldie has pointed out, the bug is not consistent, sometimes it happens right away and sometimes it takes a few hovers, and it seems to enlarge/shrink the text randomly.

The three primary solutions are as follows:

  1. Set the font to MS Gothic or some other Japanese font using font-family style.
  2. Change the font size to be anything outside the 9px ~ 11px range (Under the default IE8 font settings, 1em sized text will not be affected, but slightly smaller text (eg, 0.8em) will be affected).
  3. Force IE8 to display the page as if it was IE7 by adding the following in the header:
    <meta http-equiv="X-UA-Compatible" content="IE=7" />

I went with #2 because MS Gothic looked jarring next to all the other MS P Gothic text, and felt #3 had clear disadvantages for our site.

It's not an ideal solution, but it works. Best of luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文