仅当用户运行Linux时,如何使用特定字体? [英] How can I use a specific font only when the user is running Linux?

查看:652
本文介绍了仅当用户运行Linux时,如何使用特定字体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检测使用JQuery或CSS的操作系统?使用CSS我指的是类似<![if!IE]>

Is there a way to detect a Operating system using JQuery or CSS? With CSS I'm referring to something similar to <![if !IE]>

只有当使用Linux浏览网页时才使用特定字体,并且不希望将其与其他操作系统一起使用

I need to use a specific font only when web page is viewed using Linux and don't want to include this with other os's

推荐答案

不直接回答检测O / S的问题,您可以使用 font-family CSS属性。

Though not directly answering the question of "detecting O/S", you may be able to achieve the desired effect of selecting a font using the font-family CSS property.

选择了字体列表,其中浏览器将尝试匹配系统上可用的字体。它从左到右读取,并使用第一种字体:

This property lets you chose a list of fonts, where the browser will try to match fonts available on the system. It reads left-to-right and will use the first font available:

body
{
    font-family: "Calibri", "Arial", "Sans Serif"
}

这种情况下,如果Calibri字体不可用,系统将使用Arial。如果找不到Arial,它将使用Sans Serif系列中的任何可用字体。

In this case, if the "Calibri" font is not available, the system will use "Arial". If "Arial" cannot be found, it will use any available fonts from in the "Sans Serif" family.

使用这个选项,您可以先指定Linux特定字体,知道没有可用字体的其他平台也将使用合适的字体显示。

With this you can specify your Linux-specific font first and know that other platforms without the font available will display using a suitable font too.

这篇关于仅当用户运行Linux时,如何使用特定字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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