Monospace CSS在Chrome(Android版)中无法使用 [英] Monospace CSS not working in Chrome for Android

查看:435
本文介绍了Monospace CSS在Chrome(Android版)中无法使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的个人网站上绘制等宽的代码。以下CSS样式适用于桌面浏览器(和适用于Android的Firefox),没有问题,但在Android版Chrome上失败:

I'm trying to render code in monospace on my personal web site. The following CSS style works on desktop browsers (and Firefox for Android) without issues, but fails on Chrome for Android:

.code {
    font-family:Consolas,"Courier New","Liberation Mono",monospace;
    background-color:#F0F0F0;
}

添加Droid Sans Mono不起作用:

Adding Droid Sans Mono does not help:

.code {
    font-family:"Droid Sans Mono",Consolas,"Courier New","Liberation Mono",monospace;
    background-color:#F0F0F0;
}

只需使用 font-family:monospace 在Chrome for Android上正常运行,但是这样做会失去在桌面操作系统上使用特定字体的能力。

Simply using font-family:monospace works correctly on Chrome for Android, but by doing so, I lose the ability to use specific fonts on desktop operating systems.

如何获取代码在Android上使用等宽字体显示,而不会失去在其他平台上使用特定字体的能力?我不想使用自定义字体,如这个问题,我只想使用系统提供的等宽字体。

How do I get code to display with a monospaced font on Android without losing the ability to use specific fonts on other platforms? I don't want to use custom fonts as suggested by the answer to this question, I just want to use the monospaced font provided by the system.

为了参考,样式文件是< a href =http://www.fierydragonlord.com/styles.css =nofollow>此处。

For reference, the style file is here.

推荐答案

更新到Chrome 30后,它现在可以正常工作。看起来像浏览器错误...

It now works after updating to Chrome 30. Looks like a browser bug after all...

这篇关于Monospace CSS在Chrome(Android版)中无法使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆