CSS: font

您所在的位置:网站首页 css的font-family CSS: font

CSS: font

2022-09-21 21:57| 来源: 网络整理| 查看: 265

CSS: font-family By Xah Lee. Date: 2018-11-04. Last updated: 2022-02-23.

font-family property lets you specify a font.

Example:

body { font-family: Arial, sans-serif; } pre {font-family: Consolas, Menlo, monospace;} Possible Font Values

Value can be a single value e.g.

font-family: Arial;

or a sequence of values, like this

font-family: Consolas, Menlo, monospace;

Browser will use the first one available on user's computer.

Generic Font Names

There are these special generic values:

serif a serif font browser uses as default. sans-serif a sans serif font browser uses as default. monospace a fixed-width font browser uses as default. cursive a cursive font browser uses as default. fantasy a fantasy font browser uses as default. system-ui user's operating system font.

Here is how it looks in macOS.

css generic font names macOS 2020-11-04 kYBQs CSS generic font names on MacOS, 2020-11-04 css generic font names Windows 10 2021-07-21 CSS generic font names Windows 10, 2021-07-21 Quote Font Name that Has Space

If font name contains space, it should be quoted. (no quote often works but may not if the font name start with a number or is a CSS keyword. )

h1 { font-family:'Times New Roman', serif; } Font Name is Not Case Sensitive

For font examples, see Common Web Fonts

Font font-family Common Web Fonts Metrically Compatible Fonts font-size Meaning of Font Size Chinese Font


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3