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

输出量

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 中文文字字体

css 中文文字字体_使用CSS的网络字体相关推荐

  1. 【源码+演示】高考加油!HTML+CSS特效文字祝福_程序员祝福高考学子旗开得胜!

    又是一年盛夏至,愿高三学子高中毕业日,即是高中名校时! 本篇为大家带来3款HTML+CSS制作出的小项目,为高考学子加油助威,愿他们旗开得胜,金榜题名![源码+演示]高考加油!HTML+CSS特效文字 ...

  2. js拆字_分图程序 _制作个人字体_手写字制作ttf字体方法

    js拆字_分图程序 _制作个人字体_手写字制作ttf字体方法 前言 FontForgeBuilds制作ttf FontForgeBuilds制作个人字体 Adobe_Fireworks_CS5批量转换 ...

  3. css实现图片虚化_什么? CSS 阴影竟然还有这种骚操作 ?

    点击上方"IT平头哥联盟",选择"置顶或者星标" 与你一起成长- 原作者:cocoqiao 关于 CSS 阴影,之前已经有写过一篇,box-shadow 与 f ...

  4. div css将文字居中显示图片,css文字居中、图片居中、div居中解决方案

    一.文字居中 若文字只有一行 文本只有一行 .box { width: 200px; height: 200px; background-color: red; } .text { line-heig ...

  5. css设置按钮样式_使用CSS设置按钮样式的快速指南

    css设置按钮样式 by Ashwini Sheshagiri 通过Ashwini Sheshagiri Buttons have become an inevitable part of front ...

  6. 使用HTML语言和CSS开发商业站点_初识CSS

    第4章 初识CSS 一.CSS概述     1.什么事CSS         CSS全称为层叠样式表(Cascading Style Sheet),通常又称为风格样式表(Style Sheet),它是 ...

  7. matplotlib的默认字体_浅谈matplotlib默认字体设置探索

    控制默认字体的设置 根据官方文档https://matplotlib.org/tutorials/text/text_props.html#default-font可知: The base defau ...

  8. truetype字体怎么转换成普通字体_如何创建自己的字体和编辑TrueType字体 | MOS86

    Wouldn 在这篇文章中,我显然,付费的程序往往具有更多的功能和更好的界面来处理字体,但也有一些很好的免费的. 免费字体编辑器 Let有几百万字体可以在线下载或购买,所以如果你 创建新字体的最简单方 ...

  9. css字体_在css中如何引入ttf文件的字体

    有时我们需要使用ttf文件中的字体,那如何导入呢? 1.将文件放入项目文件夹中: 2.在css文件中使用font-face语法引入指定字体 @font-face{font-family:Product ...

最新文章

  1. 健身提示:跑步一周只需三次 天天跑易疲劳
  2. 基于移动机器人的拣货系统研究进展
  3. python操作微信小程序云端数据库_微信小程序云开发之数据库操作
  4. python基础代码事例-Python基础总结成千行代码,让Python入门更简单!
  5. 毫无疑问的是.NET 在信创常用软件适配清单之中
  6. vue-cli proxy中跨域中pathRewrite配置理解
  7. Centos7查看网络配置
  8. ps切图导出html,ps网页切图-如何用PS切图和输出网页
  9. Python flask入门
  10. GMSL部分问题解答/含官方FAE解答
  11. mysql log-slave-update_mysql数据库log-slave-updates 参数解释
  12. python画蛋糕祝福图片_蛋糕祝福语创意幽默 创意卡通生日蛋糕图片
  13. OpenGL: 位图字体
  14. 茶学领域如何用的上计算机,优秀茶学论文参考文献 茶学专著类参考文献哪里找...
  15. MosMedData: 新冠肺炎胸部 CT扫描数据集上基于3D-CNN实现二分类
  16. python 图标拖_托盘图标在Python中的应用,图标是gon
  17. php 生成性格图片,PS制作个性文字人物图像教程
  18. tcp通信服务器获取当前时间并发送到客户端
  19. 因果效应与uplift模型
  20. 数据分析常用的软件及工具

热门文章

  1. MySQL(8)存储过程和函数
  2. php决策管理,报表管理与数据分析:为系统未来发展规划提供决策依据,有效避免IT管理与投资的盲目??...
  3. es 删除重复数据_怎么标识并删除SPSS数据库里的“重复个案”?
  4. 关于“xxx”object is not callable的异常
  5. pytorch 查看参数是否被训练 require_grad()
  6. 面试题2021-2-24
  7. ubuntu好文收集
  8. ubuntu进行apt-get时候出现Package ssh is not available, but is referred to by another package 错误...
  9. Codeforces 757B - Bash's Big Day(分解因子+hashing)
  10. MySQL5.7.17的简单配置文件