css 中文文字字体_使用CSS的网络字体

css 中文文字字体

CSS | 网络字体 (CSS | Web fonts)

Web fonts allow people to use fonts that are not pre-installed in their computers. When you want to include a particular font simply include the font file on your browser and it will be downloaded.

Web字体允许人们使用计算机中未预装的字体。 当您想包含特定字体时,只需在浏览器中包含字体文件,即可下载该文件。

Your fonts are specified within the CSS @font-face rule.

您的字体在CSS @ font-face规则中指定。

In this rule firstly specify the name of the font you wish to use and point to the font file.

在此规则中,首先指定要使用的字体名称,然后指向字体文件。

不同的网络字体格式 (Different web font formats)

  1. TrueType Fonts(TTF):

    TrueType字体(TTF)

    This is a standard font developed by Apple and Microsoft in the late 1980s. TrueType is the most commonly used font format for both the Mac OS and Microsoft Windows operating systems.

    这是Apple和Microsoft在1980年代后期开发的标准字体。 TrueType是Mac OS和Microsoft Windows操作系统最常用的字体格式。

  2. OpenType fonts(OTF):

    OpenType字体(OTF)

    This is a format for scalable computer fonts developed by Microsoft. OpenType fonts are widely used today on the major computer platforms.

    这是Microsoft开发的可缩放计算机字体的格式。 如今,OpenType字体已在主要计算机平台上广泛使用。

  3. Web Open Font Format (WOFF):

    Web开放字体格式(WOFF)

    It is a font format for use in web pages. It was developed in 2009. This font format is essentially OpenType or TrueType with compression and additional metadata. Its goal is to support font distribution between a server and a client over a network with bandwidth constraints.

    它是一种用于网页的字体格式。 它于2009年开发。此字体格式本质上是OpenType或TrueType,带有压缩和其他元数据。 它的目标是支持具有带宽限制的网络上的服务器和客户端之间的字体分配。

  4. SVG Fonts/Shapes:

    SVG字体/形状

    These fonts allow SVG to be used as glyphs when displaying text. You can also apply CSS to SVG documents and to the SVG documents text the @font-face rule can be applied.

    这些字体允许在显示文本时将SVG用作字形。 您还可以将CSS应用于SVG文档,也可以将@ font-face规则应用于SVG文档文本。

  5. Embedded OpenType Fonts (EOT):

    嵌入式OpenType字体(EOT)

    EOT fonts designed by Microsoft are a compact form of OpenType fonts used as embedded fonts on web pages.

    Microsoft设计的EOT字体是OpenType字体的紧凑形式,用作网页上的嵌入式字体。

Syntax:

句法:

@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}

Note: Always use lower case letters for font url.

注意:字体URL始终使用小写字母。

Example:

例:

<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
font-family: myFirstFont;
src: url(sansation_light.woff);
}
* {
font-family: myFirstFont;
}
</style>
</head>
<body>
<div>
This is a web font i wish to include in my browser.
</div>
</body>
</html>

Output

输出量

web fonts example 1

In the above example, a sansation_light web font is used. In location, we have specified the direct location of the font as it was in our folder that contained the main file you need to use the correct location of the file of the font to add it to your website. Using a direct URL is also possible.

在上面的示例中,使用了sansation_light Web字体 。 在位置中,我们已经指定了字体的直接位置,因为它在包含主文件的文件夹中,因此您需要使用该字体文件的正确位置将其添加到您的网站。 也可以使用直接URL。

CSS Font Descriptors

CSS字体描述符

  • font-family: It is used to define the name of the font you wish to use.

    font-family :用于定义您要使用的字体的名称。

  • src: It is used to specify the URL of the web font.

    src :用于指定Web字体的URL。

  • font-stretch: It is used to specify how to font should be stretched. Some values are normal, condensed, ultra-condensed, etc.

    font-stretch :用于指定应如何拉伸字体。 一些值是normal , condensed , ultra-condensed等。

  • font-style: It is used to specify the style you wish to use for the font. There are three values: normal, italic and oblique.

    font-style :用于指定希望用于字体的样式。 有三个值: 正常 , 斜体和倾斜 。

  • font-weight: It is used to define the boldness of the font used. Its values are normal and bold.

    font-weight :用于定义所用字体的粗体。 其值是正常和粗体 。

翻译自: https://www.includehelp.com/code-snippets/web-fonts-using-css.aspx

css 中文文字字体

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/543819.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Ajax实践之用户是否存在

关于Ajax在之前的学习中&#xff0c;已经对它的基础知识有了初步的了解。仅仅是欠实践。那么接下来就让实践来检验一下真理吧&#xff01; 基础见&#xff1a;http://blog.csdn.net/liu_yujie2011com/article/details/29812777 那么先回忆一下&#xff0c;Ajax是用来解决什么问…

vb 导出整数 科学计数法_可整数组的计数

vb 导出整数 科学计数法Problem statement: 问题陈述&#xff1a; Given two positive integer n and m, find how many arrays of size n that can be formed such that: 给定两个正整数n和m &#xff0c;找出可以形成多少个大小为n的数组&#xff1a; Each element of the …

C4.5决策树算法概念学习

数据挖掘一般是指从大量的数据中自动搜索隐藏于其中的有着特殊关系性的信息的过程。 •分类和聚类•分类(Classification)就是按照某种标准给对象贴标签&#xff0c;再根据标签来区分归类&#xff0c;类别数不变。•聚类(clustering)是指根据“物以类聚”的原理&#xff0c;将本…

python修改y轴刻度_Python | Y轴刻度限制

python修改y轴刻度In some cases, we need to visualize our data within some defined range rather than the whole data. For this, we generally set the y-axis scale within a limit and this ultimately helps us to visualize better. Sometimes, it acts as zooming a…

em算法示例_带有示例HTML'em'标签

em算法示例<em>标签 (<em> Tag) <em> tag in HTML is used to display the text in emphasized form. <em> tag add semantic meaning to the text, text inside it is treated as emphasized text. HTML中的<em>标记用于以强调形式显示文本。 &…

联合使用 HTML 5、地理定位 API

查找并跟踪位置坐标以用在各种 Web 服务中 在这个由五个部分所组成的系列的第一部分中&#xff0c;您将接触到移动 Web 应用程序中最流行的新技术&#xff1a;地理定位。高端智能手机都内置 GPS&#xff0c;现在您将了解 Web 服务如何使用它。在本文中&#xff0c;您将学到如何…

list下界_下界理论

list下界下界理论 (Lower Bound Theory) Lower bound (L(n)) is a property of the specific problem i.e. the sorting problem, matrix multiplication not of any particular algorithm solving that problem. 下界(L(n))是特定问题(即排序问题)的矩阵&#xff0c;不是解决该…

Mac OSX 安装nvm(node.js版本管理器)

我的系统 1.打开github官网https://github.com/&#xff0c;输入nvm搜索,选择creationix&#xff0f;nvm&#xff0c;打开 2.找到Install script&#xff0c;复制 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash . 3. 打开终端&#xf…

HTML中的类属性

The class attribute in HTML is used to specify or set a single or multiple class names to an element for an HTML and XHTML elements. Its majorly used to indicate a class in a style sheet. HTML中的class属性用于为HTML和XHTML元素指定或设置一个元素名称或多个类…

关于HTML5标签不兼容(IE6~8)

HTML5的语义化标签以及属性&#xff0c;可以让开发者非常方便地实现清晰的web页面布局&#xff0c;加上CSS3的效果渲染&#xff0c;快速建立丰富灵活的web页面显得非常简单。 比较常用的HTML5的新标签元素有&#xff1a; <header>定义页面或区段的头部&#xff1b;<na…

zzz,zzz,zz9_ZZZ的完整形式是什么?

zzz,zzz,zz9ZZZ&#xff1a;睡觉&#xff0c;无聊&#xff0c;累 (ZZZ: Sleeping, Bored, Tired) ZZZ is an abbreviation of "Sleeping, Bored, Tired". ZZZ是“睡觉&#xff0c;无聊&#xff0c;累了”的缩写 。 It is an expression, which is commonly used in …

uboot启动 及命令分析(3)

u-boot命令 先贴一个重要结构,位于uboot/include/command.h,这个结构代表每个uboot命令 struct cmd_tbl_s { char *name; /* Command Name */ int maxargs; /* maximum number of arguments*/ int repeatable;/* autorepeat allowed? */ /* Implem…

Mozilla开源了VR框架A-Frame

Mozilla创建并开源了A-Frame&#xff0c;这是一个用于在桌面浏览器、智能手机和Oculus Rift上创建VR场景的框架。\\A-Frame是一个在浏览器中创建VR体验的开源框架。该框架由Mozilla的MozVR团队创建和开发。A-Frame使用了一个在游戏开发中经常使用的“实体-组件&#xff08;Enti…

css网格_CSS网格容器

css网格CSS | 网格容器 (CSS | Grid Containers) There are numerous ways to display our list items or elements. For instance, we can display them in the navigation bar, in a menu bar and whatnot. Well, it would be right to say that there are many more such me…

c ++向量库_在C ++中对2D向量进行排序

c 向量库As per as a 2D vector is concerned its a vector of a 1D vector. But what we do in sorting a 1D vector like, 就2D向量而言&#xff0c;它是1D向量的向量 。 但是我们在对一维向量进行排序时所做的工作 sort(vector.begin(),vector.end());We cant do the same …

监听文本框数据修改,特别是微信等客户端直接选择粘贴修改

2019独角兽企业重金招聘Python工程师标准>>> // 手机号码信息加载验证 $(input).bind(input propertychange, function() { initPage.checkName(); }); 转载于:https://my.oschina.net/u/1579617/blog/550488

SSIA的完整形式是什么?

SSIA&#xff1a;主题说明一切 (SSIA: Subject Says It All) SSIA is an abbreviation of "Subject Says It All". SSIA是“主题说明一切”的缩写。 It is an expression, which is commonly used in the Gmail platform. It is written in the subject of the mail…

服务器控件转换成HTML

服务器控件转换成HTML<asp:Label ID"Label1" runat"server" Text"I am label"><asp:Literal ID"Literal1" runat"server" Text"I am a literal"><asp:Panel ID"Panel1" runat"serv…

Eratosthenes筛

什么是Eratosthenes筛&#xff1f; (What is Sieve of Eratosthenes?) Sieve of Eratosthenes is an ancient algorithm of finding prime numbers for any given range. Its actually about maintaining a Boolean table to check for corresponding prime no. Eratosthenes的…

微信iOS多设备多字体适配方案总结

一、背景 2014下半年&#xff0c;微信iOS版先后适配iPad, iPhone6/6plus。随着这些大屏设备的登场&#xff0c;部分用户觉得微信的字体太小&#xff0c;但也有很多用户不喜欢太大的字体。为了满足不同用户的需求&#xff0c;我们做了全局字体设置功能&#xff0c;在【设置-通用…