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,一经查实,立即删除!

相关文章

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>标记用于以强调形式显示文本。 &…

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…

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

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

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…

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

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

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

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

python点线图_Python | 点线图

python点线图A mixture of dot and line plot is called a Dot-Line plot. Each dot is connected through a line and it is the next version of the line plot. It maintains the discrete property of the points and also represents the correlation between consecutive…

Android Studio导入工程的正确姿势

为什么80%的码农都做不了架构师&#xff1f;>>> 如果你有很好的网络环境 好的网络环境&#xff0c;这里不是指&#xff1a;我家网速带宽100M&#xff0c;电信的光纤接入。 而是&#xff1a;能翻墙。因为如果本机的gradle和将要导入的工程版本不匹配&#xff0c;Stu…

为什么年轻人挣得很多还是穷?北上广深挑战指数报告~

又是年底&#xff0c;又到了做选择的时候。从“激情燃烧的岁月”到“何处安放的青春”&#xff0c;逃离北上广深的口号从未停止过&#xff0c;回到北上广深的呼喊更是一浪接着一浪。应届生们奔波忙碌&#xff0c;想有一份承载自己梦想的工作&#xff0c;想在异乡有一处安身之所…

apple组织名称是什么_什么是Apple Macintosh?

apple组织名称是什么苹果Macintosh (Apple Macintosh) Steve Jobs and Steve Wozniak has founded the line of computers in the year 1984, on the date 24th January, named it Apple Macintosh. Macintosh is shortly abbreviated as Mac. In this, various versions of co…

CentOS 创建SVN 服务器,并且自动同步到WEB 目录

CentOS 创建SVN 服务器&#xff0c;并且自动同步到WEB 目录 标签&#xff1a; centossvnsubversion服务器2013-12-06 10:09 5492人阅读 评论(0) 收藏 举报分类&#xff1a;linux&#xff08;5&#xff09; 一、安装Subversion #yum install subversion二&#xff0c;基本的SVN服…

TTYL的完整形式是什么?

TTYL&#xff1a;稍后再与您交谈 (TTYL: Talk To You Later) TTYL is an abbreviation of Talk To You Later. It is an internet slang that is most generally used in text messaging, instant messaging, and chatting on Facebook, Twitter, WhatsApp, etc. The acronym i…

zhilizhili-ui 2016始动 开始做个样例站吧 (一)

对 我又挖坑了 不过其实也不算挖坑 因为ui构建中就会有填坑的文章 之前一直在写《编写大型web页面 结合现有前端形势思考未来前端》这是一篇巨难写的文章 估计要到年中才能写好了 写作的过程中 发生了国内前端大撕逼 2015的尾声大战 是否可以宣告前端是否开始新的时代 2016年 国…

python 网格_Python | 网格到情节

python 网格Most of the time, we need good accuracy in data visualization and a normal plot can be ambiguous. So, it is better to use a grid that allows us to locate the approximate value near the points in the plot. It helps in reducing the ambiguity and t…

slr1文法_SLR的完整形式是什么?

slr1文法单反&#xff1a;单镜头反光 (SLR: Single Lens Reflex) SLR is an abbreviation of Single Lens Reflex. It is used in high standard cameras. SLR makes use of an automatic moving mirror arrangement that makes it possible for photographers to perceive pre…

vim快捷键2

一、移动光标 1、左移h、右移l、下移j、上移k 2、向下翻页ctrl f&#xff0c;向上翻页ctrl b 3、向下翻半页ctrl d&#xff0c;向上翻半页ctrl u 4、移动到行尾$&#xff0c;移动到行首0&#xff08;数字&#xff09;&#xff0c;移动到行首第一个字符处^ 5、移动光标到下一…

什么是苹果耳塞?

苹果耳塞 (Apple Earbuds) Apple Earbuds are another sound device made by Apple on 23rd October 2001. It is an in-ear sound device and it has been included in all the mobile and music devices of Apple. Apple Earbuds are quite comfortable and easy to handle w…

趣说游戏AI开发:对状态机的褒扬和批判

0x00 前言 因为临近年关工作繁忙&#xff0c;已经有一段时间没有更新博客了。到了元旦终于有时间来写点东西&#xff0c;既是积累也是分享。如题目所示&#xff0c;本文要来聊一聊在游戏开发中经常会涉及到的话题——游戏AI。设计游戏AI的目标之一是要找到一种便于使用并容易拓…